Add a link to update.php on site maintenance page

tstoeckler - May 27, 2009 - 00:09
Project:Drupal
Version:7.x-dev
Component:user interface text
Category:feature request
Priority:minor
Assigned:afreeman
Status:closed
Issue tags:ui-text, Usability
Description

If you follow the steps of updating your Drupal sites, as you should, you start by putting your site into maintenance mode.
Step 2 is visiting update.php. Therefore, when you are on admin/settings/maintenance-mode chances are you are going to visit update.php next. But there is no link to update.php from admin/settings/maintenance-mode.

Attached patch changes the description of the form on that page to include a link to update.php so that lazy people like me, can just click it, instead of having to type it into your browser every time.

The text changes from:

When set to "Online", all visitors will be able to browse your site normally. When set to "Offline", only users with the "administer site configuration" permission will be able to access your site to perform maintenance; all other visitors will see the site offline message configured below. Authorized users can log in during "Offline" mode directly via the user login page.

To:

When set to "Online", all visitors will be able to browse your site normally. When set to "Offline", only users with the "administer site configuration" permission will be able to access your site to perform maintenance tasks, such as visiting update.php; all other visitors will see the site offline message configured below. Authorized users can log in during "Offline" mode directly via the user login page.

AttachmentSizeStatusTest resultOperations
maintenance-update-link.patch1.75 KBIdlePassed: 11576 passes, 0 fails, 0 exceptionsView details | Re-test

#1

Dries - May 30, 2009 - 13:25

There are people that will want to upgrade, without knowing about update.php. So instead of writing "visiting update.php", I'd write "upgrading your site to a new version of Drupal" or something along those lines.

#2

tstoeckler - May 30, 2009 - 15:47

I had that first as well, but then I saw:

Each time a module is updated, it is important that update.php is run.

on admin/build/modules
and

Each time Drupal core or a contributed module or theme is updated, it is important that update.php is run.

on admin/reports/updates.
But since I totally agree with Dries, I'd say those other ones are usability issues and will reroll this one, with what you said in #1.

#3

tobiasb - May 30, 2009 - 17:05

Each time Drupal core or a contributed module or theme is updated, it is important that update.php is run.

Thats not true, only when a module needs an db-update.

Ever time you update an component for Drupal and this needs a database update, you will be inform on [link]status report[/link] and then you must run [Link]update.php[/link] (icon red=run update, icon green= all is ok) .

sorry for my english grammar:D

#4

tstoeckler - May 30, 2009 - 18:22

To add to that: Between a minor version upgrade of Drupal you NEVER have to run update.php because the API (and with it the DB tables) is consistent (right?).

BUT: More importantly, that is a different issue (@Razorraser: be sure to open one!). This issue is about adding a link to admin/settings/maintenance-mode which you should always visit when you run update.php.

Updated the patch. It now says:

When set to "Offline", only users with the "administer site configuration" permission will be able to access your site to perform maintenance tasks, such as running the /update script/ to update your site to a newer version of Drupal or a contributed module

(The /slashes/ show where the link is)
I know that's a bit verbose, but in Dries' proposal (#1), I did not know where to put the link.

AttachmentSizeStatusTest resultOperations
maintenance-update-link_02.patch1.83 KBIdlePassed: 11576 passes, 0 fails, 0 exceptionsView details | Re-test

#5

Dries - June 1, 2009 - 16:54
Status:needs review» needs work

People that can access this settings page can't always upgrade the site. I think we should probably add that link conditionally.

#6

tstoeckler - June 2, 2009 - 08:21

Two questions:

1. (To anyone): How does this work, adding a link conditionally in a form's description? I tried figuring it out, but got stumped. Any hints/directions?

2. (To Dries): What's your view on the other references of update.php in Drupal help text. Should we take care of those in a similar fashion once this is settled?

#7

deekayen - June 14, 2009 - 07:43

@tstoeckler: It is undesired, but there have been update functions to run between minor versions.

Putting it in the field description is awkward. Maybe it would be better in the appropriate hook_help(). Then you could elaborate on why the link is even there.

I must be out of touch... I thought only UID 1 could run update.php unless it was unlocked in settings.php.

#8

tstoeckler - June 24, 2009 - 21:01
Assigned to:tstoeckler» Anonymous

#9

afreeman - July 2, 2009 - 05:29
Assigned to:Anonymous» afreeman
Status:needs work» needs review

link added conditionally.

AttachmentSizeStatusTest resultOperations
maintenance-update-link_03.patch2.03 KBIdlePassed: 11576 passes, 0 fails, 0 exceptionsView details | Re-test

#10

tstoeckler - July 2, 2009 - 12:39

Wow, I did not know Drupal's Form API is that cool...

From #7:

Putting it in the field description is awkward. Maybe it would be better in the appropriate hook_help(). Then you could elaborate on why the link is even there.

still stands...

#11

afreeman - July 2, 2009 - 16:28

I've moved the conditional text to hook_help(). Does this work?

AttachmentSizeStatusTest resultOperations
maintenance-update-link_04.patch1.51 KBIdlePassed: 11567 passes, 0 fails, 0 exceptionsView details | Re-test

#12

deekayen - July 2, 2009 - 19:46

Does l('update.php', 'update.php') work instead of creating a hard-coded HTML link?

#13

Dries - July 2, 2009 - 20:27

These globals can be put on a single line.

#14

tobiasb - July 3, 2009 - 10:17

And what is that ...return '<p>' . t('<p>If you are upgrad .... :D

#15

Dries - July 3, 2009 - 11:02
Status:needs review» needs work

Updating status to reflect reality. ;-)

#16

tobiasb - July 3, 2009 - 11:33
Status:needs work» needs review
AttachmentSizeStatusTest resultOperations
maintenance-update-link_05.patch2.99 KBIdlePassed: 11576 passes, 0 fails, 0 exceptionsView details | Re-test

#17

Dries - July 4, 2009 - 14:30
Status:needs review» fixed

Committed to CVS HEAD.

#18

System Message - July 18, 2009 - 14:40
Status:fixed» closed

Automatically closed -- issue fixed for 2 weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.