Update according to hook_theme api changes

sanduhrs - October 27, 2009 - 12:03
Project:Coder
Version:7.x-1.x-dev
Component:Review/Rules
Category:bug report
Priority:normal
Assigned:Unassigned
Status:needs review
Description

Code review doesn't display results table because of api changes in hook_theme, see #600974: theme() fails for theme functions taking one argument in renderable arrays

Thos are the messages i got:

    *  Notice: Undefined index: render element in theme() (line 803 of /home/sauditor/workspace/nowblogging/includes/theme.inc).
    * Notice: Undefined index: form in theme_coder_review_table_cols() (line 534 of /home/sauditor/workspace/coder/coder_review/coder_review.module).
    * Warning: Invalid argument supplied for foreach() in theme_coder_review_table_cols() (line 537 of /home/sauditor/workspace/coder/coder_review/coder_review.module).
    * Warning: Invalid argument supplied for foreach() in theme_coder_review_table_cols() (line 546 of /home/sauditor/workspace/coder/coder_review/coder_review.module).
    * Notice: Undefined index: render element in theme() (line 803 of /home/sauditor/workspace/nowblogging/includes/theme.inc).
    * Notice: Undefined index: form in theme_coder_review_table_cols() (line 534 of /home/sauditor/workspace/coder/coder_review/coder_review.module).
    * Warning: Invalid argument supplied for foreach() in theme_coder_review_table_cols() (line 537 of /home/sauditor/workspace/coder/coder_review/coder_review.module).
    * Warning: Invalid argument supplied for foreach() in theme_coder_review_table_cols() (line 546 of /home/sauditor/workspace/coder/coder_review/coder_review.module).
    * Notice: Undefined index: render element in theme() (line 803 of /home/sauditor/workspace/nowblogging/includes/theme.inc).
    * Notice: Undefined index: name in theme_coder_review() (line 1950 of /home/sauditor/workspace/coder/coder_review/coder_review.module).
    * Notice: Undefined index: filename in theme_coder_review() (line 1951 of /home/sauditor/workspace/coder/coder_review/coder_review.module).
    * Notice: Undefined index: results in theme_coder_review() (line 1952 of /home/sauditor/workspace/coder/coder_review/coder_review.module).
    * Notice: Undefined index: render element in theme() (line 803 of /home/sauditor/workspace/nowblogging/includes/theme.inc).
    * Notice: Undefined index: name in theme_coder_review() (line 1950 of /home/sauditor/workspace/coder/coder_review/coder_review.module).
    * Notice: Undefined index: filename in theme_coder_review() (line 1951 of /home/sauditor/workspace/coder/coder_review/coder_review.module).
    * Notice: Undefined index: results in theme_coder_review() (line 1952 of /home/sauditor/workspace/coder/coder_review/coder_review.module).
    * Notice: Undefined index: render element in theme() (line 803 of /home/sauditor/workspace/nowblogging/includes/theme.inc).
    * Notice: Undefined index: name in theme_coder_review() (line 1950 of /home/sauditor/workspace/coder/coder_review/coder_review.module).
    * Notice: Undefined index: filename in theme_coder_review() (line 1951 of /home/sauditor/workspace/coder/coder_review/coder_review.module).
    * Notice: Undefined index: results in theme_coder_review() (line 1952 of /home/sauditor/workspace/coder/coder_review/coder_review.module).

Attached is a patch that fixes the issue.

AttachmentSize
coder-review-hook_theme-01.patch1.51 KB

#1

sanduhrs - October 27, 2009 - 12:17

The Select specific modules and Select specific themes fieldsets aren't populated aswell.

#2

deviantintegral - October 31, 2009 - 03:53

This patch works for me at first blush - remember to clear your caches.

#3

ilo - October 31, 2009 - 15:34

I also tested and no errors in theme.

#4

ilo - October 31, 2009 - 16:24

Actually, it fixes the errors from theme, but make form hidden for render function. This is an updated patch.

AttachmentSize
coder-review-hook_theme-02.patch 1.24 KB

#5

pwolanin - November 2, 2009 - 16:40

patch seems to work for me

#6

JacobSingh - November 5, 2009 - 05:46

Works for me to.

#7

ilo - November 5, 2009 - 10:07

perhaps coder_upgrade should be included in this patch, it is not updated, and shows some warnings.

#8

cedarm - November 13, 2009 - 05:14

I think these coder_upgrade warnings will only show up if you have no modules enabled which implement hook_upgrades(). $upgrades_sort just needs to be initialized to an empty array(). Tacked this onto the end of the patch.

AttachmentSize
coder-review-hook_theme-03.patch 1.88 KB

#9

solotandem - November 18, 2009 - 21:05

Regarding #8 and #9, Coder upgrade has been fixed. The warnings related to the reversal of the registry changes which again requires manual inclusion of code files.

 
 

Drupal is a registered trademark of Dries Buytaert.