[development] url as callback argument
cooper Quintin
cooperq at cooperq.com
Wed Feb 4 20:24:47 UTC 2009
Since I started this thread I feel it is my duty to put it to rest. The
problem was indeed that I had callback_args instead of callback
arguments, sorry to bother this list with my stupid typo. Additionally
the below poster is correct, there is no wildcard in paths in drupal 5
which was also giving me some interesting problems. I thought that the
development list was intended for all development of drupal and its
modules but I guess its only for drupal core development, sorry about
that! Anyway, I declare this thread closed, thanks everyone for your help.
Cooper
Iñaki Lopez wrote:
> sorry, I don't know how did I realize the drupal version was six, and
> my reply was a "finish-porting-this-to-d6"..
> Now I see, only half of the menu entry is 'ported' as well..
>
> Indeed, a very bad advice at all.. where the hell is my head?.. brbr
>
> On Wed, Feb 4, 2009 at 12:32 AM, Jakob Petsovits <jpetso at gmx.at
> <mailto:jpetso at gmx.at>> wrote:
>
> On Tuesday 03 February 2009, Iñaki Lopez wrote:
> > $items[] = array(
> > 'path' => 'admin/settings/featured-comments/feature',
> > 'title' => t('featured comment'),
> > 'callback' => 'feature_comment',
> > 'callback_args' => $_GET['cid'],
> >
> > should be..
> >
> > $items[] = array(
> > 'path' => 'admin/settings/featured-comments/feature/%',
> > 'title' => t('featured comment'),
> > 'callback' => 'feature_comment',
> > 'callback_args' =>array(4),
> > ...
>
> Bad advice:
>
> 1. There is no '%' wildcard in Drupal 5, and Drupal 6 puts the
> path as array
> key instead of having a separate 'path' element.
>
> 2. There is no 'callback_args' property. array(...) is correct,
> but it also
> needs to be renamed to 'callback arguments' for Drupal to do
> anything with it.
> In Drupal 5, that would be "'callback arguments' =>
> array($_GET['cid'])".
> (Or 'page callback' and 'page arguments' in Drupal 6, which I
> understand the
> original poster is not using at this time.)
>
> Maybe the thread is better off dead -
> http://api.drupal.org/api/function/hook_menu/5 has been posted
> already -
> but it's hard to leave the above example uncommented as is.
>
> Cheers,
> j
>
>
--
Cooper Quintin
Freelance Programmer, Indymedia Journalist
http://CooperQ.com
(510) 827-5382
More information about the development
mailing list