Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Undefined property: Node::$entity_id in _webform_rules_component_property_info() #3

Open
willow-fp opened this issue Feb 28, 2025 · 2 comments

Comments

@willow-fp
Copy link

I am using the webform_rules module in Backdrop CMS to access data submitted through a webform in Rules. However, when configuring a rule, I get an error related to an undefined property.

Warning: Undefined property: Node::$entity_id en _webform_rules_component_property_info() (línea 282 de /var/www/vhosts/comunidadthreads.com/httpdocs/modules/webform_rules-1.x-1.x-issue-1/webform_rules.rules.inc).

The error occurs when I try to create a rule in Rules to process data submitted through a webform. The module does not seem to be able to correctly access the submission data.

function _webform_rules_component_property_info($entity_id) { $info = array(); $webform = node_load($entity_id); foreach ($webform->webform['components'] as $cid => $component) { $id = "{$component['form_key']}"; $info[$id] = array( 'label' => $component['name'], 'description' => t('@component_name from @title(@entity_id)', array('@component_name' => $component['name'], '@title' => $webform->title, '@entity_id' => $webform->entity_id)), 'type' => 'list<text>', 'getter callback' => 'webform_rules_submission_data_get', ); } return $info; }

@elisseck
Copy link
Collaborator

elisseck commented Feb 28, 2025

Hi @willow-fp,

Looking at the code it looks like there was some confusion if webform remained a node or became a proper entity in Backdrop...

I haven't been able to reproduce your error clicking around a rules configuration, although I have no doubt that it's there. Can you give me some more detailed steps in configuring a rule to reproduce so I can be sure the issue is resolved? (i.e. does this happen when you submit the webform, or when you configure the rule? Are you adding a variable, calculating a value, etc)

@willow-fp
Copy link
Author

Hii @elisseck

Issue with converting a text field to an integer:
I tried to read the value of a text field to convert it to an integer, but the text field appears empty, preventing the conversion.

Problem retrieving data from a user reference field:
When attempting to retrieve data from a user reference field, the data selector does not display the expected values, making it difficult to use.

Difficulty using a Webform numeric field to assign points in the Userpoints module:
I tried to use a numeric field from Webform to assign points in the Userpoints module, but the data selector does not allow this action. It’s worth noting that this process works correctly when using a numeric field from a node.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants