Preliminary note: I'm creating the issue so that the task doesn't get lost, but I most probably won't have time to tackle this myself :-(

After #394268: DIE update_sql() DIE!,
- hook_update_N() should not return an array anymore, just (if needed) a string message that will be displayed to the user on the results page.
- multipass updates should alter $context['#finished'] instead or returning $ret['#finished']

Task:
- agree on a 'standard' for when to return a user-facing message and when to just update silently ?
- move all existing core updates to the new format (might be worth waiting that the $ret parameter is removed from db_* functions - not sure if there's an issue for that already).
- remove the backward-compatibility layer in update_do_one() and update_results_page(), and streamline the code for the new, simplified result format. No more query or $query['query']...

Comments

yched’s picture

Also: document the change on the module upgrade guide.

Crell’s picture

Title: New return format for hook_update_N(). » Return meaningful messages from update hooks

#570900: Destroy remnants of update_sql() was just committed, so all that should be left here is to improve the documentation on update hooks since right now they'll pretty much all return no messages whatsoever. :-) I defer to others to decide if and what to return from the ones in core.

Oh yes, and removing the BC layer in update_do_one(). That should be easy, as the bits to remove are already marked, but there may be other cleanup possible in there as well.

sun.core’s picture

Priority: Critical » Normal

Is this really critical? I don't think so.

Status: Active » Closed (outdated)

Automatically closed because Drupal 7 security and bugfix support has ended as of 5 January 2025. If the issue verifiably applies to later versions, please reopen with details and update the version.