Various module "notices" with Drupal 6.x-dev
Ryan Palmer - July 1, 2008 - 20:19
| Project: | Content Templates (Contemplate) |
| Version: | 6.x-1.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Jump to:
Description
I have been using contemplate on a Drupal 6.2 site for a few weeks, but had to upgrade to Drupal-6.x-dev due to an issue with views (a templating issue, actually.. #275371: Problem theming a view) that required a bug fix in core.
After upgrading, I get the following errors:
* notice: Undefined variable: file in /home/brainquest/bq-drupal/sites/all/modules/contemplate/contemplate.module on line 598.
* notice: Undefined variable: file in /home/brainquest/bq-drupal/sites/all/modules/contemplate/contemplate.module on line 598.
* notice: Undefined index: flags in /home/brainquest/bq-drupal/sites/all/modules/contemplate/contemplate.module on line 486.
* notice: Undefined variable: file in /home/brainquest/bq-drupal/sites/all/modules/contemplate/contemplate.module on line 598.
* notice: Undefined index: flags in /home/brainquest/bq-drupal/sites/all/modules/contemplate/contemplate.module on line 486.
* notice: Undefined index: flags in /home/brainquest/bq-drupal/sites/all/modules/contemplate/contemplate.module on line 178.Line 178:
<?php
case 'alter':
if ($template = contemplate_get_template($node->type)) {
if ($teaser) {
if (CONTEMPLATE_TEASER_ENABLED & $template['flags'] && trim($template['teaser'])) { // only if there's content in teaser field
$node->teaser = contemplate_eval($template['teaser'], $node, $xml_elements);
}
}
elseif (CONTEMPLATE_BODY_ENABLED & $template['flags'] && trim($template['body'])) { // only if there's content in the body field // LINE 178
$node->body = contemplate_eval($template['body'], $node, $xml_elements);
}
}
break;
?>Line 486:
<?php
foreach ($fields as $field => $enable) {
if ($file = contemplate_get_file($type, $field)) {
$types[$type][$field] = $file->contents;
$types[$type][$field .'-file'] = $file;
$types[$type]['flags'] |= $enable; // if there is a file, the field is always enabled...
}
$types[$type][$field .'-enabled'] = $types[$type]['flags'] & $enable ? TRUE : FALSE; // LINE 486
}
?>Line 598:
<?php
function contemplate_get_file($node_type, $field) {
$files = contemplate_available_files();
if (isset($files['node-'. $node_type .'-'. $field .'.tpl'])) {
$file = $files['node-'. $node_type .'-'. $field .'.tpl'];
}
elseif (isset($files['node-'. $node_type .'.tpl'])) {
$file = $files['node-'. $node_type .'.tpl'];
}
elseif (isset($files['node.tpl'])) {
$file = $files['node.tpl'];
}
if ($file) { // LINE 598
$file->contents = file_get_contents($file->filename);
$return = $file;
}
else {
$return = FALSE;
}
return $return;
}
?>
#1
If it makes any difference:
MySQL database 4.1.10
PHP 5.2.6
PHP memory limit 128M
PHP register globals Disabled
Unicode library Standard PHP - Operations on Unicode strings are emulated on a best-effort basis. Install the PHP mbstring extension for improved Unicode support.
Web server Apache/2.0.46 (Red Hat)
#2
This is almost certainly a Drupal core problem. I'm getting similar errors with the core Search and the contributed TinyMce 2 (6.x-1.1-dev (2008-Mar-31)) modules.
I am running Drupal 6.x-dev (2008-Jul-05).
#3
BTW, here are specific errors:
* notice: Undefined index: body_field in /homepages/18/d93080087/htdocs/drupal6/sites/scratch.cambre.biz/modules/tinymce 2/tinymce.module on line 90.* notice: Undefined index: #type in /homepages/18/d93080087/htdocs/drupal6/modules/search/search.module on line 1097.
#4
Adjusting title.
#5
Please don't mix bug reports. The search index already has an open ticket (always search first, before opening new issues). The errors you listed in the initial report are clearly the fault of contemplate.module and nothing to do with Drupal core, so moving this issue back over to that queue.
Additionally, notices are not "critical" bugs. Notices are relatively harmless and are thus normally suppressed; the development versions of Drupal display them to help developers to not write code with notices in it.
#6
Thanks. Didn't realize that distinction about "notices."
#7
Changing title.
BTW, webchick, I would search if a search engine was available!
#8
Issue search is always available. :D http://drupal.org/project/issues/search/
#9
THANK YOU!!!
#10
Seems to be fixed when used in conjunction with Drupal 6.3. I'm not sure what specifically was fixed.
#11
as webchick said in comment #5 in the dev releases the notices are enabled, in the stable release the notices are suppressed.
#12
Yep. I assume this is still a problem in dev releases.