Setting language when a node is created by rules/ language neutral is not possible even by edit form

Events happening in the community are now at Drupal community events on www.drupal.org.
tobiberlin's picture

Hi,

I have the following problem: By flagging a special node (content type "service") a new node (content type "order") should be created which is done by Rules. Now the new node has always the language which is active during the time the user flags the service node but it would be better to get it as language neutral.

Even when I open this new node and change the language to "neutral" the node language will always be set to language which is currently active - although I did not check the button "Set current language as default for new content." or "Require language (Do not allow Language Neutral)." in the content type setting. Can anybody help me????

Greez,
Tobias

Comments

Try something like this

andy inman's picture

I haven't tried it, but creating PHP action which runs before the new node is saved:

$node->language = FALSE;

... will probably work. Maybe better to unset $node->language - I am not sure without checking whether (for "language neutral" nodes) it is normally set but blank or simply undefined.



Currently part of the team at https://lastcallmedia.com in a senior Drupal specialist role.

Internationalization

Group organizers

Group categories

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: