Bug 27158

Summary: software error
Product: Koha Reporter: Nishath Ahmed <nishathahmed>
Component: Architecture, internals, and plumbingAssignee: Bugs List <koha-bugs>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: major    
Priority: P5 - low CC: jonathan.druart, m.de.rooy, nishathahmed
Version: 20.11   
Hardware: All   
OS: Linux   
GIT URL: Initiative type: ---
Sponsorship status: --- Comma delimited list of Sponsors:
Crowdfunding goal: 0 Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:
Attachments: Koha-sys-info
Koha-shelves-info

Description Nishath Ahmed 2020-12-04 19:56:50 UTC
Hi THere,
In the given link on OPAC (i.e.) your list
http://localhost/cgi-bin/koha/opac-shelves.pl?op=list&category=1

when I click I get following error
Software error:

DBIx::Class::Storage::DBI::_dbh_execute(): Unknown column 'me.created_on' in 'field list' at /usr/share/perl5/Data/Page.pm line 49

For help, please send mail to the webmaster ([no address given]), giving this error message and the time and date of the error. 

Please help me out. Thanks!
Comment 1 Jonathan Druart 2020-12-09 12:54:40 UTC
Which exact version of Koha are you using, 20.11.00?
How did you install it? Did you upgrade from a previous version of Koha?
Did you restart the different services?

% sudo service apache2 restart
% sudo service koha-common restart
Comment 2 Nishath Ahmed 2020-12-10 12:45:52 UTC
Created attachment 114305 [details]
Koha-sys-info

Dear Jonathan Druart ,
I tried everything and dropped a bug here. I have attached system information for your reference.

Regards!
Nishath
Comment 3 Jonathan Druart 2020-12-10 12:53:29 UTC
Does the column virtualshelves.created_on exist in DB?

% koha-mysql $INSTANCE
MariaDB > desc virtualshelves;

You should see:
| created_on               | datetime     | NO   |     | NULL                ||
Comment 4 Nishath Ahmed 2020-12-10 13:12:01 UTC
Created attachment 114307 [details]
Koha-shelves-info

cgi-bin/koha/opac-shelves.pl
Comment 5 Jonathan Druart 2020-12-10 13:19:55 UTC
So you don't have the column. That's very weird, it has been added by 3.19.00.038, so a long time ago.

From which Koha version did you upgrade?

You can try the two following queries, to add the missing column, but you should have seen an error during the upgrade.
ALTER TABLE virtualshelves
ADD COLUMN created_on DATETIME NOT NULL AFTER lastmodified;

UPDATE virtualshelves
SET created_on = lastmodified, lastmodified = lastmodified;
Comment 6 Nishath Ahmed 2020-12-11 12:18:48 UTC
Jonathan Druart,
Got it! Thanks for your kind help. By the way why it wasn't altered during upgrade I mean (upgrade-database-schema) command. 

Anyways many thanks!

Regards!