If you give "create content" access for a certain content-type to Anonymous users they get to see the complete form but when you submit it only the title/body is saved. The content in the cck fields doesn't get saved.

If, after the submit, you check the content_type_content-type table a row wasn't even inserted.

Comments

jax’s picture

Title: Anonymous content doesn't get saved » Increase default weight of trigger module
Project: Content Construction Kit (CCK) » Drupal core
Version: 6.x-2.1 » 6.10
Component: content.module » trigger.module

The reason content didn't get saved was because I had a trigger that redirected to a URL when new content was submitted. Trigger module does the redirect on hook_nodeapi('insert') which means that other modules cannot save their content if the hook in trigger module is called before them. I think that because of the behaviour of Trigger it should have a default weight other than 0 since it is better to call this module's hooks last.

andypost’s picture

Version: 6.10 » 7.x-dev
Issue tags: +actions, +triggers, +trigger

Should be fixed in D7 first

andypost’s picture

andypost’s picture

neochief’s picture

Gotcha! I'm experiencing it too.

andypost’s picture

callison’s picture

I manually updated the weight of the module in my database and could not get this working with any weight. So, I'm wondering if this is not the real issue here. I tested this using the instructions at #560150: Trigger for redirect to url action causes email to not be sent after users register.

neochief’s picture

I have same issue as callinson. I've tried to change weights, but no luck. It seems that it's different issue.

andypost’s picture

There's a 2 troubles with triggers:
1) weight of the module
2) user_save which should not be used for assigning redirect triggers because mostly called within some workflow

First we should fix #601398: Simpletest does not allow assigning actions to triggers which is blocker of all trigger's tests
Next #286668: Trigger "User logging in" doesn't work with Action "Forward to URL" should fix redirect behavior for "url-destination"
And finally re-invent a redirect action to work after form submit and user_save

vitis’s picture

sub

francewhoa’s picture

Confirming that this issue is present in Drupal 5, 6 and 7.x dev.

Maybe when fixed with Drupal 7 it could be back port to Drupal 5 & 6?

Any volunteer for a patch? I'm not a coder but I would be happy to contribute testing.

Detailed steps to reproduce issue in Drupal 7.x dev http://drupal.org/node/560150

Thanks andypost for following up on this issue :)

andypost’s picture

This could not be fixed til #601398: Simpletest does not allow assigning actions to triggers

We need working tests to continue work on triggers

andypost’s picture

user_save() already fixed. So is this still an issue?

francewhoa’s picture

Priority: Normal » Critical

Confirming that this is still an issue with Drupal 7 alpha 3. The issue is that Action/Trigger for redirect to url action causes email to not be sent after users register. In other words after user clicks the CREATE NEW ACCOUNT button a registration email should be send to the user's email address. But the email is never send. So user can't log-in to access the Drupal site.

Tested following steps at http://drupal.org/node/560150 On a fresh D7 alpha setup.

Expected result is that after user clicks the CREATE NEW ACCOUNT button a registration email should be send to the email address he provided.

Setting the issue status to 'critical' because the feature isn't working and new users can't registers and access the site.

andypost’s picture

block.module already has weigth -5
so trigger.module should have maximum weight from all core modules

EDIT also possible to use http://api.drupal.org/api/function/hook_system_info_alter/7 to change weight in runtime

andypost’s picture

Status: Active » Needs review

Patch to change weight, also this could correlate with #420124: DX: Remove module actions on uninstall

andypost’s picture

StatusFileSize
new1.1 KB

Patch

Status: Needs review » Needs work

The last submitted patch, 403446-trigger-weight-d7.patch, failed testing.

andypost’s picture

I reopen #601398: Simpletest does not allow assigning actions to triggers to fix bug with using drupal_html_id() in simpletest, after it's fixed this patch should work

andypost’s picture

Status: Needs work » Needs review
Issue tags: -actions, -triggers, -trigger

#17: 403446-trigger-weight-d7.patch queued for re-testing.

Status: Needs review » Needs work
Issue tags: +actions, +triggers, +trigger

The last submitted patch, 403446-trigger-weight-d7.patch, failed testing.

andypost’s picture

Status: Needs work » Needs review
StatusFileSize
new2.33 KB

One test was not fixed in #601398: Simpletest does not allow assigning actions to triggers
So here re-roll

EDIT: patch to fix test are also posted as follow up #241013: Actions only trigger one action per node page load

agentrickard’s picture

Status: Needs review » Needs work

Setting the weight is not the proper response to this problem. Removing drupal_goto() from the system_goto_action() is.

I am very tempted to mark this as a duplicate of #732542: system_goto_action breaks core APIs, which fixes this issue by replacing the drupal_goto().

As it is, I will mark 'needs work', as this patch does not remove the potential problem. Using drupal_goto() in this manner is dangerous, and setting module weight is a brittle fix.

I think if the other patch lands, this should solve itself.

andypost’s picture

Status: Needs work » Closed (duplicate)
keinstein’s picture

The suggested value 5 in the patch doesn't leave very much room for other modules to act after default weight modules and before trigger. Rules uses 20. I'd expect both modules to be have the same weight. It must be heigher than e.g. the xmlsitemap weights.

This issue leads to many duplicate key errors in combination with xmlsitemap_node, cck and other modules that have weight 0 (race condition) or higher values.

Vote for backport to D6.

keinstein’s picture

Version: 7.x-dev » 6.16
Status: Closed (duplicate) » Active

reopening as there are many issues with the weight of the trigger module around see (e.g. #757348).

andypost’s picture

Version: 6.16 » 7.x-dev
Status: Active » Closed (duplicate)

@keinstein dont change status, this issue caused by wrong workflow not the weigth of the module. Take care to look at #732542: system_goto_action breaks core APIs

Primary we should fix D7 and only then backport to D6 if it possible

PS #757348: Warning appears on site after enabling taxonomy_term view could be related but all discussion goes in #732542: system_goto_action breaks core APIs

keinstein’s picture

Version: 7.x-dev » 6.9

OK. I will file a new one.
#757348 is not related.
#732542 might be related, but seems not to be my issue. My issue is related due to updating a node before all parts are saved well. It has nothing to do with redirects.