Closed (fixed)
Project:
Protected Node
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
8 Nov 2014 at 10:47 UTC
Updated:
26 Sep 2024 at 10:15 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
izus commentedhi,
as tested in https://www.drupal.org/node/2371613#comment-9387241
it is possible to do this on existing node when editing per exemple
Comment #2
sportel commentedThanks for your response.
With https://www.drupal.org/node/2371613#comment-9387241, I can get it to work. But I'm trying to get to this:
I'm using Drupal Commerce for a shop (I hope you know how Commerce works, or else this probably won't make much sense to you). I'm using rules to automatically create a Product Display when I create a product. I added a field "password" to the product-type. When a password is entered when I create a product, that password has to be used to password-protect the Product Display.
I don't know how to fit the password part to my rule. This is how my rule looks now:
EVENT:
After saving a new commerce product
ACTIONS:
Create a new entity (entity type=node, content type=product_display)
Set a data value (data=productdisplay-created:field_product_reference, value=commerce-product)
Safe entity (entity=product_display-created)
I hope you can help?
Thanks,
Mike.
Comment #3
sportel commentedWhen I create a new rule that react on the event: Before saving content, with the action to set the password (test) on a node of type product_display, I get this error (when saving a new product):
First I assumed it was because of the Auto Entity Label module (hence my other issue), but now it looks like the rule is in fact trying to set the password (test) but can't set it because it has no value for the 'protected_node_show_title' field in the database. Well, that's what I make of this error, but maybe I'm wrong.
Comment #4
sportel commentedNot sure if the title is still accurate, but I think the issue remains.
Comment #5
grimreaperI reproduce the error.
Comment #6
grimreaperI add a boolean in the password protect action so you can set the proerty protected_node_show_title.
I wanted this boolean to appear as a checkbox but I have not find how to easily do it. and I prefer going to another issue.
Comment #7
grimreaperHi sportel,
Did you test the patch and did it solve your issue ?
Comment #8
grimreaperI add an automated test to rules extension.
Unfortunately I can't make it extends ProtectedNodeBaseTestCase.
Comment #10
grimreaperLast patch merged.
Comment #12
grimreaper