Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
We still have lots of code and comments referring to core/update.php
. This url does not exist.
Proposed resolution
Change to use the system.db_update
route or the correct path.
Remaining tasks
Task | Novice task? | Contributor instructions | Complete? |
---|---|---|---|
Create a patch | Y | Instructions | |
Update the issue summary | Y | Instructions | |
Review patch to ensure that it fixes the issue, stays within scope, is properly documented, and follows coding standards | Instructions |
User interface changes
Correct links in the UI
API changes
None
Comment | File | Size | Author |
---|---|---|---|
#18 | interdiff.txt | 994 bytes | trzcinski.t@gmail.com |
#18 | core_update_php_is_now-2338759-18.patch | 10.74 KB | trzcinski.t@gmail.com |
#15 | core_update_php_is_now-2338759-15.patch | 9.96 KB | StryKaizer |
#11 | core_update_php_is_now-2338759-11.patch | 9.96 KB | StryKaizer |
#7 | core_update_php_is_now-2338759-7.patch | 9.96 KB | StryKaizer |
Comments
Comment #1
alexpott#2250119: Run updates in a full environment was the issue that introduced the regression.
Comment #2
StryKaizerWorking on this
Comment #3
StryKaizerComment #4
alexpottCan we use
\Drupal::url('system.db_update');
so that we use the new routing system instead.Comment #5
StryKaizerNew patch using the new routing system now.
Comment #6
alexpottLooking good - a couple of minor nits. It would also be good to do some manual testing and provide some evidence (eg html output) since we obviously don't have test coverage
We need to wrap the comment at 80 characters
Here we should add another variable to the $this->t() args so we can use the route.
Comment #7
StryKaizerChanges added following suggestions in #6
Output below generated using patch #7
Comment #8
geodaniel CreditAttribution: geodaniel commentedThis patch works as expected for me. My only comment would be that it seems like it would be better to use the new routing system for
url('admin/reports/updates')
as well, for a bit of extra consistency. I.e.\Drupal::url('update.status')
Comment #9
StryKaizerHi geodaniel,
Makes sense, I will adjust those urls too.
Comment #10
geodaniel CreditAttribution: geodaniel commentedI haven't looked at any of the routing bits before, so I'm only presuming it's right to use them both in the same way. I gave it a quick try though and it seemed to work as it should. Thanks for the patches.
Comment #11
StryKaizerAs suggested in #8, the attached patch uses the new routing system for the "admin/reports/updates" url now.
Output with new patch for changed lines is correct:
Comment #15
StryKaizerUpdated patch to match current 8.0.x
Comment #16
StryKaizerMarking as needs review
Comment #17
trzcinski.t@gmail.com CreditAttribution: trzcinski.t@gmail.com commentedHi - thanks for the patch. Here`s what I`ve done:
I have read the patch line by line and it looks alright - I did not find any inconsistencies.
I have applied the patch as well - no problems with this. In all cases the links have been changed.
There is one thing though that I think might need some work:
in system.install file line 451 you have something like this:
$requirements['update']['description'] = t('Some modules have database schema updates to install. You should run the <a href="@update">database update script</a> immediately.', array('@update' => \Drupal::url('system.db_update')));
whereas a few lines later (line 459) it looks the same except the link:
$requirements['update']['description'] = t('Some modules have database schema updates to install. You should run the <a href="@update">database update script</a> immediately.', array('@update' => base_path() . 'update.php'));
why don`t we use the same
\Drupal::url('system.db_update')))
in both cases?In addition I am not actually sure about the coding conventions - the thing about 80 chars in line - some of the comments and longer strings exceed this limits.
Other than that I think this is RTBC - I just need a clarification on those two issues.
Comment #18
trzcinski.t@gmail.com CreditAttribution: trzcinski.t@gmail.com commentedI have created a patch to include the changes I found in system.install file. I attached modified patch and an interdiff.
Comment #19
Robin_K CreditAttribution: Robin_K commentedPatch applies correctly against current dev and looks clean.
The coding standards of the System module is a separate issue: #1533400: Make system module (except tests subdirectory) pass Coder Review, which makes this issue fixed with the patch in #18.
Marking RTBC.
Comment #20
alexpottCommitted 9315a45 and pushed to 8.0.x. Thanks!
Comment #23
StryKaizer