Closed (fixed)
Project:
Custom Tokens
Version:
7.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
6 May 2012 at 00:49 UTC
Updated:
12 Sep 2012 at 14:38 UTC
Hi there...
I needed a way to extract the node id for a node a user created.... The users are only allowed 1 creation of the node type, limit made with nodelimit, I needed to create a custom token so I could use it in a menu token to make a "edit node" menu
My custom PHP for the token looks like this
global $user;
$result = db_query('SELECT nid FROM {node} WHERE uid = :uid AND type = :type', array(':uid' => $user->uid, ':type' => 'nodetype'))->fetchField();
return $result;
And it wors like a charm, Got my menu now, but occasionalily I get this error
Warning: extract() [function.extract]: First argument should be an array i eval() (linje 2 af D:\Apache2.2\htdocs\booking\modules\php\php.module(80) : eval()'d code)
Anyone who could finetune my code s this does not happen?
Comments
Comment #1
gaspaio commentedI released a 2.0-beta1 version that should correct this.
Comment #2
acoustika commentedThx alot....
I downloaded the latest dev from 7 May and will let you know how it behaves :-)
Comment #3
acoustika commentedOkay.... This seems to work properly now, thx alot...... Did the commit instead, the change wasn't refelcted yet in the version I downloade.... Thumbs up
Comment #4
gaspaio commented