I get the following right after installing rdfx.module, wondering if there is a conflict between the xsd:token stuff in rdfx module and Token module:

Warning: uasort(): The argument should be an array in token_get_info() (line 226 of /var/www/html/sites/all/modules/token/token.module).
Notice: Undefined index: tokens in token_get_info() (line 227 of /var/www/html/sites/all/modules/token/token.module).
Warning: array_keys(): The first argument should be an array in token_get_info() (line 227 of /var/www/html/sites/all/modules/token/token.module).
Warning: Invalid argument supplied for foreach() in token_get_info() (line 227 of /var/www/html/sites/all/modules/token/token.module).
Warning: array_keys(): The first argument should be an array in token_get_info() (line 233 of /var/www/html/sites/all/modules/token/token.module).
Warning: Invalid argument supplied for foreach() in token_get_info() (line 233 of /var/www/html/sites/all/modules/token/token.module).
Warning: array_keys(): The first argument should be an array in theme_token_tree() (line 40 of /var/www/html/sites/all/modules/token/token.pages.inc).
Warning: Invalid argument supplied for foreach() in theme_token_tree() (line 53 of /var/www/html/sites/all/modules/token/token.pages.inc).

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

deltab’s picture

And in Watchdog, I see this:

Warning: array_keys(): The first argument should be an array in theme_token_tree() (line 40 of /var/www/html/sites/all/modules/token/token.pages.inc).
Warning: Invalid argument supplied for foreach() in theme_token_tree() (line 53 of /var/www/html/sites/all/modules/token/token.pages.inc).

----------------------------------

the warnings disappear as soon as I disable rdfx, however, while the module is installed, no tokens are visible on ./admin/help/token page, just the warnings.

scor’s picture

Could you post the versions of the modules you're using (token, rdfx, plus others?)

deltab’s picture

hi, with Drupal Core: 7.0-beta3 just these three modules:

Pathauto: 7.x-1.0-alpha2
Token: 7.x-1.0-alpha3
RDFx: 7.x-2.x-dev

I am on RHEL 5, PHP 5.2x. Initially, when the error occurred, I also had Automatic Nodetitles 7.x-1.0-alpha1 and some CCK modules such as Name Field 7.x-1.0-alpha1, Email 7.x-1.0-alpha2 etc., however, for the latest, I am using just Patauto, Token and all RDFx modules (Evoc, RdfUI, Rdfx). The error occurs when I enable rdfx.module.

Dave Reid’s picture

I think I've narrowed this down. Because the url() function is used to define a constant, something is going horribly horribly wrong because that causes Drupal to invoke hooks before all modules are loaded, and then it causes Drupal to miss hook definitions of modules not yet included, like Pathauto.

In short, don't use url() until all modules are loaded!

Dave Reid’s picture

Title: Potential conflict with Token Module? » RDFx causes mayhem by using url() before all modules are loaded
Status: Active » Needs review
FileSize
1015 bytes

Simple solution, remove the define() since it's unnecessary and not even used in any of the module code (I grepped for it and there were 0 results).

Dave Reid’s picture

Anonymous’s picture

Thanks so much for ferreting this out, Dave Reid. This was part of functionality that scor had in RDF CCK that created a site vocab to describe all fields. I'm not sure whether he's planning on implementing it in D7, but this seems like a pretty big issue so let's clear it up now and add in something that doesn't cause mayhem later if we need it.

Dave Reid, is the second hunk in the patch necessary for this fix? Or is that related to another issue?

Dave Reid’s picture

It was something I saw while going through the code in the area that seems like it would be a best practice.

Anonymous’s picture

Status: Needs review » Fixed

Thanks, everyone :) This has been fixed with the commit in https://github.com/scor/rdf/commit/2e747b347f5db7b334a1604e12dfb981266ed9b3

I'll be adding the second hunk as another issue since scor has been dealing more with this part of the module than I have, so give him a chance to look it over.

Blooniverse’s picture

Great! Thanks. When are you going to publish the new module version on http://drupal.org/project/rdf?

scor’s picture

Changes committed to CVS. The 7.x-2.x-dev tarball should be updated automatically in a few hours.

Status: Fixed » Closed (fixed)

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

milesw’s picture

Project: Resource Description Framework (RDF) » RDF Extensions