LibreBooking / app

Repository for the last open source version of Booked Scheduler. The "develop" branch contains the most current working code of the project and should be considered beta. The "master" branch is the most current stable release of BookedScheduler. Please read doc/README.md for further details.
GNU General Public License v3.0
369 stars 220 forks source link

Cannot rename resources #148

Open lukebarone opened 1 year ago

lukebarone commented 1 year ago

Updated as of this morning to version 2.8.5.5, using MariaDB hosted on the same server.

Steps to reproduce

  1. Application Management -> Resources
  2. Click to rename a resource. Type the new name and hit the check box.
  3. Refresh the page. The name is still the same. Uncaught exception appears in log:
2022-11-02T09:02:41-07:00 [289208] ERROR default - [User=Luke Barone (tech@example.com)] ProcessAction Error. Action rename, Error Exception: There was an error executing your query\nUnknown column 'additional_properties' in 'field list' in /var/www/BookedScheduler/lib/Database/MySQL/MySqlConnection.php:114
Stack trace:
#0 /var/www/BookedScheduler/lib/Database/MySQL/MySqlConnection.php(101): MySqlConnection->_handleError()
#1 /var/www/BookedScheduler/lib/Database/Database.php(63): MySqlConnection->Execute()
#2 /var/www/BookedScheduler/Domain/Access/ResourceRepository.php(228): Database->Execute()
#3 /var/www/BookedScheduler/Presenters/Admin/ManageResourcesPresenter.php(346): ResourceRepository->Update()
#4 /var/www/BookedScheduler/Presenters/ActionPresenter.php(68): ManageResourcesPresenter->Rename()
#5 /var/www/BookedScheduler/Pages/Admin/ManageResourcesPage.php(563): ActionPresenter->ProcessAction()
#6 /var/www/BookedScheduler/Pages/ActionPage.php(27): ManageResourcesPage->ProcessAction()
#7 /var/www/BookedScheduler/Pages/Admin/AdminPage.php(27): ActionPage->PageLoad()
#8 /var/www/BookedScheduler/Web/admin/manage_resources.php(9): AdminPageDecorator->PageLoad()
#9 {main} [File=/var/www/BookedScheduler/Presenters/ActionPresenter.php,Line=71]

Looking in the database at the Resources table, I see these headers:

lukebarone commented 1 year ago

Well I feel silly now... Apparently I missed that I have manual steps during upgrades. I ran mysql booked < database_schema/upgrades/2.8/schema.sql and it's working now.

So suggestion: when a database upgrade is needed, either to automatically apply them, or tell the admin user when they log in that upgrades are needed.