Hi

Recently I updated the CTools and Services modules and I started to have some problems with the Drupal, caused by a bug in Module Services.

Part of the problems were resolved by the sponsors of the respectives areas and the pillarsdotnet, which helped me a lot (see the topic here: http://drupal.org/node/1141838).

However, there remained a problem involving a core of Drupal. On every page of the site appears the following message:

warning: Invalid argument supplied for foreach() in /home/xxxxxx/public_html/modules/trigger/trigger.module on line 174.

This error message is displayed on all pages of the site, including the content pages.

I use the module "Front" to define the access to a custom page for each available language in the site, which is called "home". This page is based on views and displays information from the general content of the site in its own language.

These pages are no longer being displayed and the server response is error 404.

Since I never faced problems on this scale, if possible, I would like to receive additional instructions for correcting the mistakes.

Greetings.

Comments

astutonet’s picture

Category: support » feature
Priority: Major » Critical

Complementing the above message:

This problem affects even other versions of Drupal. In the topic mentioned above, a patch was made ​​available to the Trigger Module by pillarsdotnet, which can be seen here - #8 - and here - trigger-1141838-8.patch.

Notice that I use a different version of the Drupal mentioned above and I need help to solve my problem.

Priority changed: Major areas of the site are partially unavailable.

Greetings.

pillarsdotnet’s picture

Category: feature » bug
Priority: Critical » Normal
Status: Active » Needs review
StatusFileSize
new1.11 KB

The patch is against Drupal 6.20.

astutonet’s picture

The patch was applied and the message "warning" has been removed. The error 404 was also removed.

The content that should appear on each page is empty. I created a new issue for the Pages module at this address: http://drupal.org/node/1144238.

Thanks.

astutonet’s picture

The problem pointed in #3 was solved. Tks.

bleen’s picture

Status: Needs review » Reviewed & tested by the community

#2 seems to be working fine for us ... RTBC

pillarsdotnet’s picture

Status: Reviewed & tested by the community » Needs work

NOT RTBC. The patch in #2 is a work-around, not a fix.

pillarsdotnet’s picture

Status: Needs work » Closed (cannot reproduce)

Unless someone else can reproduce the error, this issue should be closed.

liliplanet’s picture

patch in #2 fixed the problem, thank you!

pillarsdotnet’s picture

Status: Closed (cannot reproduce) » Needs work

According to the hook_hook_info() documentation, this error should not happen.

pillarsdotnet’s picture

Would anyone who is still experiencing this problem or who has used the patch from #2 to solve it please apply this patch instead?

Then cut-and-paste any generated warning into this issue so we can find the real source of this bug.

gateway69’s picture

Im getting this now with my upgrade to 6.22 from 6.20.. tried the patch but seemed to fail, going to manually adjust the code

patch -p0 < troubleshooting_trigger_hooks-1143174-10.patch
patching file b/modules/trigger/trigger.module
Hunk #1 FAILED at 169.
1 out of 1 hunk FAILED -- saving rejects to file b/modules/trigger/trigger.module.rej

gateway69’s picture

Version: 6.20 » 6.22
Priority: Normal » Major

Ok manually changed the page.. here is the full function that removed the warnings, but gave me another issue with another module, not sure if its related, going to look at that next..

drupal 6.22

/**
 * Implementation of hook_forms(). We reuse code by using the
 * same assignment form definition for each node-op combination.
 */
function trigger_forms() {
  $hooks = module_invoke_all('hook_info');
  foreach ($hooks as $module => $info) {
    //foreach ($hooks[$module] as $hook => $ops) {
    foreach ($info as $hook => $ops) {
      if (!is_array($ops)) {
        $message = 'Module "%module" has defined a hook "%hook" whose value @value is not an array.';
        $value = str_replace(
          array("'", "\n"),
          array('"', '\n'),
          $ops
        );
        $args = array(
          '%module' => $module,
          '%hook' => $hook,
          '@value' => $value,
        );
        drupal_set_message(t($message, $args), 'error');
        watchdog('trigger', $message, $args, WATCHDOG_ERROR, 'http://drupal.org/node/1143174');
        continue;
      }		
		  foreach ($ops as $op => $description) {
        $forms['trigger_'. $hook .'_'. $op .'_assign_form'] = array('callback' => 'trigger_assign_form');
      }
    }
  }

  return $forms;
}

the new error im getting and not sure if its related to the change in trigger form..

Module "service_links" has defined a hook "group" whose value service_links is not an array.
Module "service_links_alter" has defined a hook "group" whose value service_links is not an array.

which is not an array sorta kinda makes me think it might be related..

gateway69’s picture

yea in triggers admin menu, the service links tab is empty..

ST

pillarsdotnet’s picture

Project: Drupal core » Service links
Version: 6.22 » 6.x-2.x-dev
Component: trigger.module » Code

Redirecting...

TheCrow’s picture

Status: Needs work » Closed (duplicate)