Download & Extend

warning: Invalid argument supplied for foreach() in...

Project:Resource Conflict
Version:5.x-1.0
Component:Code
Category:bug report
Priority:normal
Assigned:deemuzi
Status:closed (fixed)

Issue Summary

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)));
                }
              }
            }
          }
        }

Comments

#1

Status:active» postponed (maintainer needs more info)

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

Status:postponed (maintainer needs more info)» fixed

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

Status:fixed» closed (fixed)

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

nobody click here