One of the things I loved about D5 was the workflow-ng module that allowed me to run custom PHP code when certain criteria were met.
I went "away from Drupal" for a while (life took over), and when I came back I decided to rebuild my site using D6.
...except I've tried everything I can think of with Actions, and the newfangled Rules modules, and it would seem I've lost the "custom code" functionality, unless I want to start messing around inside Drupal itself with the same reckless bull-in-a-china-shop approach with which Dr. House approaches a brain biopsy.
What I'm trying to do is relatively simple - when a user creates or updates one of two specific content types, call a PHP script, depending on which type of content it is.
Can someone steer me in the right direction? Thanks!
Comments
_
It's in the rules module-- after you choose the event, both the actions and conditions configuration allow for php code.
===
"Give a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime." - Lao Tzu
"God helps those who help themselves." - Ben Franklin
"Search is your best friend." - Worldfallz
Here's what I see in the
Here's what I see in the dropdown for "Select an action to add" in the Rules Edit screen:
CCK
- Populate a field
Content Profile
- Load content profile
Content Access
- Grant content permissions by role
- Reset content permissions
- Revoke content permissions by role
Node
- Add new content
- Load content by id
- Make content sticky
- Make content unsticky
- Promote content to front page
- Publish content
- Remove content from front page
- Save content
- Save the content author
- Unpublish content
- Unpublish content containing keyword(s)
Rules
- Add a new date variable
- Add a new number variable
- Add a new string variable
- Add a new truth value variable
System
- Display a tokenized message to the user
- Log to watchdog
- Page redirect
- Redirect to a tokenized URL
- Send a mail to a user
- Send a mail to all users of a role
- Send a mail to an arbitrary mail address
- Send a tokenized e-mail
- Set breadcrumb
- Show a configurable message on the site
User
- Add user role
- Ban IP address of current user
- Block a user
- Load a user account
- Remove user role
The only one of those that - to me - could suggest custom PHP code would be the redirect...is that the one?
Additionally, I just saw the following on top of this edit screen, although it doesn't seem to be interfering with the dropdown...
* warning: Illegal offset type in /blahblah/modules/rules/rules/rules.module on line 381.
* warning: Illegal offset type in /blahblah/modules/rules/rules/rules.module on line 382.
* warning: Illegal offset type in /blahblah/modules/rules/rules/rules.module on line 381.
* warning: Illegal offset type in /blahblah/modules/rules/rules/rules.module on line 382.
Does this make it any clearer?
Thanks again!!
Sorry for the double-post.
Sorry for the double-post. It would seem those lines in rules.module relate to loading other modules. So perhaps THIS is why I'm not getting the option to add custom PHP code. Investigating further.
THIS seems to at least partially address the problem, will try the "fix"...
http://drupal.org/node/361875
It would seem that this exactly the problem, although no fix exists yet. See above link if you feel like chipping in.
Make sure that you have
Make sure that you have enabled the "php filter" module in admin/build/modules. In Drupal 6 it is disabled by default.
_
Yes--- and the item you're looking for in the drop down is:
It should appear between the "Node" and "Rules" sections.
===
"Give a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime." - Lao Tzu
"God helps those who help themselves." - Ben Franklin
"Search is your best friend." - Worldfallz
Yeah, that was the source of
Yeah, that was the source of my PHP problem. Duh. Should have thought of it. As I recall, it was enabled by default in D5.
Still getting the other error, though...but addressing it in the appropriate space.
Thanks again.
_
Actually, in d5 it wasn't a separate module so it's easy to miss this step in d6.
===
"Give a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime." - Lao Tzu
"God helps those who help themselves." - Ben Franklin
"Search is your best friend." - Worldfallz
yuchu, thanks guys
yuchu, thanks guys