Call to undefined function token_get_list()
/sites/all/modules/faq/faq.module on line 1481

Comments

bensnyder’s picture

StatusFileSize
new1.1 KB

commented out

ChrisFlink’s picture

The Drupal 6 function token_get_list() doesn't exist in the Drupal 7 version.

Below is what the Drupal 6 version looks like, I haven't found the Drupal 7 variant yet...

function token_get_list($types = 'all') {
  token_include();
  $return = array();
  settype($types, 'array');
  foreach (module_implements('token_list') as $module) {
    $function = $module .'_token_list';
    foreach ($types as $type) {
      $result = $function($type);
      if (is_array($result)) {
        foreach ($result as $category => $tokens) {
          foreach ($tokens as $token => $title) {
            // Automatically append a raw token warning.
            if (substr($token, -4) === '-raw' && strpos($title, t('raw user input')) === FALSE && strpos($title, '1269441371') === FALSE) {
              $title .= ' <em>' . t('Warning: Token value contains raw user input.') . '</em>';
            }
            $return[$category][$token] = $title;
          }
        }
      }
    }
  }
  return $return;
}
dave reid’s picture

Status: Active » Needs work

You could always look to the Pathauto version for Drupal 7 to see what you're supposed to do...

$settings['token_type'] = 'term';
ChrisFlink’s picture

Status: Needs work » Needs review
StatusFileSize
new1.07 KB

If I understand it correctly (and please check because I am not familiar with the faq, token or pathauto module) the code should be changed in three ways:

  1. The part where patterns are retrieved should be removed from faq_pathauto
  2. The token type should not be 'taxonomy' but 'term'
  3. The patterndefault value should not be t('faq/[catpath-raw]') because catpath-raw is an invalid token. I changed it to t('faq/[term:vocabulary]') in the attached patch

The patch attached contains these three changes, I am unsure about the last one, especially about what the default value should be,
I hope this helps in fixing this issue. Thanks Dave for giving me some new insights!

d.olaresko’s picture

tested it. Works fine for me. thx

p.brouwers’s picture

Status: Needs review » Reviewed & tested by the community

Reviewed the patch and confirmed that it works perfectly now.

bluesomewhere’s picture

patch worked for me, much thanks.

sarjeet.singh’s picture

claudiu.cristea’s picture

Works. Why not commit?

TimelessDomain’s picture

patch worked for me - please commit

jief’s picture

StatusFileSize
new1004 bytes

Rerolling patch from MadChris to be compatible with Drush Make

damienmckenna’s picture

+1 for the patch in #11.

jeffwidman’s picture

subscribe

bramface’s picture

+2 for the patch in 11 after upgrading to dev versions of pathauto and token in order for pathauto patterns to display.

mstrelan’s picture

+3 for the patch in 11

mxt’s picture

I've got the same issue: can this patch be commited?

Thank you.

pbuyle’s picture

In #1052470: FAQ 7.x uses Pathauto 6.x API, I made a patch that fix this issue and two others undefined function calls related to Pathauto.

SilviaT’s picture

Waiting for this patch to be committed too.

thijsvdanker’s picture

subscribe and +1

teamA’s picture

+1 for commit - solved the issue in #1052470: FAQ 7.x uses Pathauto 6.x API as well.

recidive’s picture

Priority: Major » Critical

+1 tested an fixed the problem.

Bumping to critical as it makes pathauto module unusable.

mikefyfer’s picture

patch in comment 11 worked for me too.

LagPRO-dupe’s picture

Patch #4 worked.

rmiddle’s picture

+1

dadderley’s picture

The patch in 11 fixed it for me.

tinarey’s picture

Priority: Critical » Major

+1 for #11

stella’s picture

Status: Reviewed & tested by the community » Fixed

Committed, thanks!

rmiddle’s picture

Confirming the latest dev version fixed this issue for me :).

Thanks
Robert

Status: Fixed » Closed (fixed)

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