Closed (fixed)
Project:
Webform Rules
Version:
7.x-1.0
Component:
Documentation
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
6 Sep 2011 at 16:41 UTC
Updated:
8 Dec 2011 at 02:24 UTC
Jump to comment: Most recent
Comments
Comment #1
stborchertPlease install devel (http://drupal.org/project/devel) and try
Could you please post a screenshot of the structure that is returned.
Comment #2
eric-ie commentedThanks stBorchert,
I've been using Devel but I'm not really clear where i would put this dsm($data) function. If it put it on the page I get no results. If I put it in the fields of a Rule it causes and error. I tried dpm() and dsm().
UPDATE:
Okay i added dpm($data) to a node--webform.tpl.php to see whats going on. It comes back with
a:2:{s:7:"overlay";i:1;s:7:"contact";i:1;}However if i add dpm($webform) i get returned a pretty complicated array.
Comment #3
eric-ie commentedWell I'm getting data out with this function in the PHP Evaluation field inside a Rule.
I'm still learning some PHP/Drupal stuff, so this is working but it doesn't really seem optimal to me. Any suggestions how to streamline this process? It looks like the webform is returning a Name-Value pair? That's why i have this for loop, but probably there is a better way.
For instance this function:
Which outputs "Applicant Name, Array, "
Any advice would be appreciated.
Comment #4
stborchertTry to put the
dsm(),dpm()inside your rule (right beforeforeach).Comment #5
Anonymous (not verified) commentedHi stBorchert
How to "php" "name" only the "value" for one place and another "php" for email in another place?
Best regards
ArchGalileu
Comment #6
stborchert@ArchGalileu: Sorry, but I don't understand your last question. Could you please rephrase it and try to explain what you'd like to do?
Comment #7
Anonymous (not verified) commentedHi @stBorchert
Sorry for my english :-)
Question: How to "code" in "php" for rules module the data from webform ex. name and email?
Because to create an entity from webform is not recognized the data values but there is a field to "php code".
Best regards
ArchGalileu
Comment #8
stborchert@ArchGalileu: try using the Devel module to print out the structure of
$data.For instance, if it (
<?php dpm($data); ?>returns something likeyou can print out the values with
<?php print $data['name'][0]['value']; ?>respectively<?php print $data['email'][0]['value']; ?>.Comment #9
Anonymous (not verified) commentedThanks @stBorchert
It works :-)
Best regards
ArchGalileu
Comment #10
stborchertComment #12
eric-ie commentedDid this change when 7.9 came out? I upgraded and now the $data array in all my Webform rules is blank. I dsm($data) on node--webform.tpl and get
a:2:{s:7:"overlay";i:1;s:7:"contact";i:1;}Any insite into tracking this down. It's pretty rough getting any testing data out... if you have a dsm in your PHP filter where does that even show up? Your form gets submitted then the page refreshes, does the dsm show up on the new page or in the admin/reports? I'm not seeing it anywhere.