We use a couple of modules that use the arg function ( http://api.drupal.org/api/function/arg/6 ) to determine what to do. For example, the Taxonomy Access Control module uses it in hook_db_rewrite_sql like this.
$op = (arg(0) == 'node' && (arg(1) == 'add' || arg(2) == 'edit')) ? 'create' : 'list';
When HS is used during node creation for example, arg(0) becomes hierarchical_select_json. The Multistep module also uses arg to determine the current step it is on. This causes problems using HS and these modules together.
Is there a way to determine what the original path was when hierarchical_select_json is called? This way I could modify the Taxonomy Access Control and Multistep modules to check if arg(0) is hierarchical_select_json, then use some other way to find the same information the arg function would have given us. Perhaps there is a better way to do this?
Thanks
Comments
Comment #1
wim leersI've been out of my game for a while, but I'd say that using arg() to steer form logic in a uniform manner (including for AHAH/AJAX forms) is wrong. You should rely on the form id instead.
Let me know if that doesn't work out, I'll help you find a solid method.
Comment #2
drenton commentedHi Wim, thanks for the info. Form id is not available in hook_db_rewrite_sql, unless I use $_POST. Would you recommend using $_POST ?
In the meantime I have changed the HS path like this in hook_form_alter.
$form['taxonomy'][30]['#config']['path'] = $form['taxonomy'][30]['#config']['path'] . request_uri();Then in taxonomy_access_db_rewrite_sql I did this.
Thanks
Comment #3
wim leersI think that's a safe work-around :)