Closed (fixed)
Project:
Custom review
Version:
5.x-2.0-1
Component:
Code
Priority:
Critical
Category:
Bug report
Assigned:
Reporter:
Created:
16 Jun 2008 at 18:41 UTC
Updated:
19 Jun 2008 at 02:01 UTC
There is a small error in condition in custom_review_form_alter():
Error message:
warning: array_key_exists() [function.array-key-exists]:
The first argument should be either a string or an integer in
/home/x/public_html/modules/custom_review/custom_review.module on line 177
Solution - change:
$short_type = substr($form_id, 0, -10); // 'short_type_node_form' => 'short_type'
if (array_key_exists($short_type, $custom_review_reviewers)) {
to:
$short_type = substr($form_id, 0, -10); // 'short_type_node_form' => 'short_type'
if (!empty($short_type) && array_key_exists($short_type, $custom_review_reviewers)) {
Comments
Comment #1
Striky2 commentedWow nice! I'll do my best to change that today. Thx! Btw, if you want to become co-maintainer of the module, feel free to ask! I'm seeing that people are interested in the way it works, so it can be great if we help each other on the module.
And I now get why I didn't see it... I was testing the module on an environment where warning logs were deactivated :)... oops!
Comment #2
Striky2 commentedfixed in DRUPAL-5--2-1-1. thx again
Comment #3
Striky2 commentedComment #4
Striky2 commentedother error :
$short_type = substr($form_id, 0, -10); // 'short_type_node_form' => 'short_type'
if (!empty($short_type) && !empty($short_type) && array_key_exists($short_type, $custom_review_reviewers)) {