Sometimes the back end of you site gets an urgent security update. Such was the case of Drupal 7.59.
Now Drupal is a nasty thing to update. When we started trying to update it we had numerous times where it just wouldn’t work.
If you are also working with a DKAN website here is how we did it.
First of all before anything else we need to make sure we can access the update report. This should be accessible from the admin menu by clicking
reports -> available updates
If you can access the available updates section you need to reactivate the module. Do this by going to modules and searching for update then turning update manager back on.
Now make a backup of your site and database. If everything goes pear-shaped then at least you can restore it back to what it was.
Once you have a backup and everything is safe download a copy of the drupal update from their site. Generally when there’s an update to Drupal you can go right to the update page from DKAN by going on the available updates page.
Once that is downloaded you want to take the contents of the update and copy it into the /html file of the server. This should replace some files but not all of them.
Next run update.php which should show us what updates need making and does them.
You should switch to maintenance mode as suggested when you do this. There is a prompt to go to the page but if you cant find it then its under
configuration -> development -> maintenance mode
Simply check the tickbox and save. Uncheck it afterwards to exit maintenance mode.
If you see errors about modules missing before you update ABORT!
You did something wrong when setting it up and things will go very wrong if you try to update. Like this:
Avoid this if you can. It’s not fun.
There are some errors that seem to pop up after the update. Some need to be dealt with, others not so much.
If you get errors about
‘Undefined index: dkan in dkan_sitewide_update_status_alter()’
and similar issues then it seems there isn’t really an issue. These errors seem to be remnants of older warnings in the code that are no longer an issue. This is the same thing for issues similar to
‘Undefined index: name in theme_update_report()’
If you want to stop DKAN from showing you all these error messages there is a module called module_missing_message_fixer you can download and install that removes them. It can be downloaded at the following link and be installed the same way as any other module.
as for how to use it here are the instructions from the page:
1.Enable the module
2.make sure you have the permission Administer Module Missing Message Fixer
3.Go to: admin/config/system/module-missing-message-fixer
Another issue was that it seems as though the Drupal update (or all of the messing about thereafter) manages to reset the permissions of the sites/default/files directory.
Even though they were all publicly available, instead of being owned by the ‘www-data’ user (the user DKAN utilises to upload temporary files possibly), they were owned by the ‘root’ user.
This would give you errors along the lines of:
The specified file temporary://fileh4Oxvi could not be copied
Running the following commands appeared to fix this:
sudo chown www-data:www-data * -R
If all has gone well things should now be working for you in drupal 7.59. Hussah!
Do note that when adding datasets this update seems to reset the check box for being published to not published.
This can be reset by going to
structure -> content types ->dataset
and changing the publishing options to published.