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.
I looked into converting this theme function however it returns an array, not HTML. Just wondering if we should eliminate this from the list.
@see template_preprocess_item_list()
@see _template_preprocess_item_list()
@see _template_preprocess_item_list_attributes()
function theme_authorize_message($variables) {
$message = $variables['message'];
$success = $variables['success'];
if ($success) {
$item = array('data' => $message, 'class' => array('success'));
}
else {
$item = array('data' => '<strong>' . $message . '</strong>', 'class' => array('failure'));
}
return $item;
}
Comment | File | Size | Author |
---|---|---|---|
#6 | d8tts-authorize-message-1823568-6.patch | 789 bytes | EVIIILJ |
#3 | d8tts-authorize-message-1823568-3.patch | 1.27 KB | EVIIILJ |
Comments
Comment #1
vlad.dancerI think it's used like hook, you can alter this theme and add your own variables or modify them. If we replace this theme by just simple func other modules couldn't modify items! What do you think?
Comment #2
vlad.dancerBetter status
Comment #3
EVIIILJ CreditAttribution: EVIIILJ commentedWell, I looked into the list_items preprocess/theme_ function and it exepts a string or array so I guess we could just pass in the HTML as the item (see template file included within this patch)
Comment #4
EVIIILJ CreditAttribution: EVIIILJ commentedforgot the status change :(
Comment #5
steveoliver CreditAttribution: steveoliver commentedNice work, EVIIILJ.
I'm pretty sure we can leave this preprocess out.
Default theme implementation for a single log message from the authorize.php batch operation.
Needs indentation.
And we can also remove this, of course.
Comment #6
EVIIILJ CreditAttribution: EVIIILJ commentedAwesome feedback steveoliver! Thank you.
Comment #7
steveoliver CreditAttribution: steveoliver commentedThis looks good, but I can't get to the screen at the end of update.php where I'd see the report messages. It gets stuck at Review updates (Step 3).
Postponed until we can get to the end of update.php.
Comment #8
jenlamptonun-postponing since I need this one back now :) I opened a core issue for the current bug: #1885788: An AJAX HTTP error occurred during module installation via UI
but it turns out that even when AJAX crashes, you can get to the reports page by clicking on the link at the top of the page with the ugly message, so moving foward on this again.
Comment #9
jenlamptonAlrighty, I had to use the trick mentioned by @artofeclipse in #1820052: Converting theme_update_page to get the preprocess function to fire for authorize_report, but by the time I got the report working the messages were perfectly fine :)
Thank you all for working on this :)
Committed and pushed to front-end.
Comment #10.0
(not verified) CreditAttribution: commentedadded ref to template preprocess functions