gue
  • Member for 9 years, 4 months
  • Last seen more than a week ago
Programmatically assign user role
14 votes

We also solved this task with the user_multiple_role_edit() function. In our usecase we didn't react on the register-form but on a special menu-callback to create users on the fly. First: Create a ...

View answer
How to get the node ID in jQuery/JavaScript
6 votes

As mentioned by MPD in his answer, working with the default css-classes Drupal generates for the element is a easy solution which works without custom PHP code. Here is our implementation: (...

View answer
What does the entity_view function do?
Accepted answer
4 votes

A EntityFieldQuery doesn't return fully loaded entities as result. Try running the query result through entity_load('type', $result['type']). Then you can render the resulting entites through ...

View answer
Removing all validation on submit
2 votes

Your '#limit_validation_errors' may be set when the form gets built, not when it's processed. Hence in your custom *_form() function or a hook_form_alter(); not in *_validation() or *_submit().

View answer
Programmatically Update Geofield Data
1 votes

A wild guess: You may run your node through the node-edit-form process to get the geofield-magic fired. Have a look at drupal_form_submit(), observe the $form_state['values'] from an ordinary, manual ...

View answer
Undefined function user_load()
1 votes

We got the same errors here. After some time we recognized that our database-import (cloning production db to local dev machine) went wrong and the database wasn't populated properly. After fixing ...

View answer
migrating from localhost to server - What to do with the folder sites/localhost.mysitename?
1 votes

I don't know the acquia product you are using. And I don't know bluehost - but it seems to be a "usual webhoster". I assume at bluehost is an ordinary LAMP stack running without any drupal-specific ...

View answer
Redirecting a page after form submission
1 votes

Beside the drupal_goto() function there's also the 'redirect' property in the $form_state See https://api.drupal.org/comment/18139#comment-18139

View answer
Grab Node ID from URL of Current Page?
0 votes

Build your own token! Your token then could analyse the current URL - double and triple validate it (don't let your page be hijacked!!!) - and return the discovered node-id. Views allow usage of ...

View answer
Why does a header set via drupal_set_header() revert to text/html?
0 votes

I think you are too late in the template_preprocess hook. The views display will have set it's header already before your hook gets called. To test my thought have a look at the return value of the ...

View answer
How do I insert a localized menu item?
0 votes

The key to have a translated URL for a menu item is to create a language specific path alias for it. This can be done in PHP - with path_save() - when your module gets installed, or manually in the ...

View answer
How to start views at %nid position (from path)?
0 votes

Since your problem is about appearance, not about structure I suggest to not solve it on the server and not in the URL path but on the client with a URL fragement: /portfolio#slide-[nid]. I've not ...

View answer