Patch includes a preprocess function in addition to a twig template.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

vlad.dancer’s picture

+++ b/core/includes/theme.maintenance.inc
@@ -228,6 +228,32 @@ function theme_authorize_report($variables) {
+ * Preprocess variables for a report of the results from an operation run via authorize.php.
+ */

Add "*" or remove this line

vlad.dancer’s picture

Status: Needs review » Needs work

Status

merdekiti’s picture

In the preprocess function you are using $item_lists[] = theme('item_list', array('items' => $items, 'title' => $heading));

The items attribute can be only an array. Please, look at the template_preprocess_item_list(&$variables)
"
...
// Items.
if ($variables['items']) {
foreach ($variables['items'] as $key => $item) {
if (is_array($item)) {
_template_preprocess_item_list_item($item);
$variables['items'][$key] = $item;
}
}
}
...
"

So could you change the line to
$item_lists[] = theme('item_list', array('items' => array($items), 'title' => $heading));

Thanks!

decafdennis’s picture

+      $items = array();
+      foreach ($logs as $number => $log_message) {
+        if ($number === '#abort') {
+          continue;
+        }
+        $items = theme('authorize_message', array('message' => $log_message['message'], 'success' => $log_message['success']));
+      }
+      $item_lists[] = theme('item_list',  array('items' => $items, 'title' => $heading));

6th line was prolly meant to append to the array and should be:

+        $items[] = theme('authorize_message', array('message' => $log_message['message'], 'success' => $log_message['success']));
EVIIILJ’s picture

@vlad.dancer: Not sure what you mean in regards to the #1? Is there a limit to the amount of characters per line for a comment?

@merdekiti and naquah: Thank you both for catching the array error!

Attached is a patch correcting the array error. I also made sure that $variables['item_lists'] was always set to the template #1822142-3: Create preprocess function for theme('node_preview') <- (bottom of this comment).

EVIIILJ’s picture

Status: Needs work » Needs review

updated status

vlad.dancer’s picture

Status: Needs review » Reviewed & tested by the community

Thanks!

podarok’s picture

Status: Reviewed & tested by the community » Fixed

Thanks!!!

commited / pushed to front-end

Status: Fixed » Closed (fixed)

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