hope info in title helps
btw: thanks for contribution of this needed module.

best regards

Comments

dqd’s picture

Version: 7.x-2.x-dev » 7.x-2.0-alpha2
dqd’s picture

sorry, I may took the wrong version...
will check out 2.x-dev now

greetings

dqd’s picture

not sure but I think it was a missing semicolon here:

/**
 * Implements hook_form_FORM_ID_alter() for search_form().
 */
function node_form_search_form_alter(&$form, $form_state) {
  $vars = new UserTweakVars();
  $options = $vars['user_tweaks_options'];

  $bool = (
    $options['advanced_node_search_filter'] &&
    isset($form['module']) &&
    $form['module']['#value'] == 'node' &&
    user_access('use advanced search')
  );
  if ($bool) {
    foreach (array_keys(node_type_get_types()) as $type) {
      if (!user_access("filter node search to $type content")) {
        unset($form['advanced']['type']['#options'][$type]); /* <-- semicolon was missing here */
      }
    }
  }
}
dqd’s picture

hm .... after adding semicolon now this error occurs:

Fatal error: Cannot redeclare node_form_search_form_alter() (previously declared in /www/htdocs/.../modules/node/node.module:2642) in /www/htdocs/.../sites/all/modules/user_tweaks/user_tweaks.module on line 144 
dqd’s picture

and I can confirm all the same happens in 2.x-dev

Anonymous’s picture

Title: syntax error, unexpected '}', expecting ';' in /sites/all/modules/user_tweaks/user_tweaks.module on line 141 » The hook has the wrong name and it misses a semicolon

Actually, the name of the hook is not correct, as every module hooks are supposed to have a name starting with user_tweaks_.

Anonymous’s picture

Status: Active » Fixed

I fixed the code, and committed in the development snapshot branch.

Thank you for your report.

dqd’s picture

thanks for clearifying, kiam.
I will check it out.

greetings

dqd’s picture

still the

Parse error: syntax error, unexpected '}', expecting ';' in /www/htdocs/.../sites/all/modules/user_tweaks/user_tweaks.module on line 145 

message after activating module 2.x-dev :(

After changing it by involving the missing ';', then the

Fatal error: Cannot redeclare node_form_search_form_alter() (previously declared in /www/htdocs/.../modules/node/node.module:2642) in /www/htdocs/.../sites/all/modules/user_tweaks/user_tweaks.module on line 148 

message comes up again. so ... sadly all still the same. Are you sure you put up the new snapshot? code looks like the same, only the update time has changed.

best regards

dqd’s picture

Status: Fixed » Active
Anonymous’s picture

Status: Active » Fixed

Development snapshot archives are generated only twice per day at 12:00 AM and 12:00 PM GMT.

The code has been changed; it has not been used to create a new archive.

Status: Fixed » Closed (fixed)

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