warning: Invalid argument supplied for foreach() in...
deemuzi - March 7, 2008 - 13:09
| Project: | Resource Conflict |
| Version: | 5.x-1.0 |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | deemuzi |
| Status: | closed |
Jump to:
Description
there is empty variable $conflict->{$field} when you use more then one resource conflict contents, or maybe it depends on my module configuration
patch:
foreach($fields as $field) {
foreach($node->{$field} as $instance) {
foreach ($overlap_nodes as $conflict) {
// my code :) don't ask me why ;))
if (empty($conflict->{$field})) { continue; }
foreach($conflict->{$field} as $conflict_instance) {
if ($instance['nid'] == $conflict_instance['nid']) {
$booked_resource = node_load($instance['nid']);
form_set_error('Resource Conflict',
t('There is a resource conflict. "%resource" is currently booked. Please choose a different time or a different resource.',
array('%resource' => $booked_resource->title)));
}
}
}
}
}
#1
Did you have this problem on your testing site as well? Anyone else having this issue?
Thanks,
--Andrew
#2
I have this problem aswell, as you say the problem should arise when other event-enabled contenttypes are missing the same node reference field as in the current node. Thanks for the patch by the way!
#3
I've committed this in CVS 124098 to the -dev version. In the future, be sure to follow the patching guidelines for drupal.
Thanks!
--Andrew
#4
Automatically closed -- issue fixed for two weeks with no activity.