I think this is a good compromise... create a new filter called php function

Comments

wizonesolutions’s picture

Oh whoa! Already an issue!

Hmm, first I'm going to go for the user-can't-enter-anything-only select route, but I'll leave this open since it might be a good idea. The big allure of PHP filter is that people can be lazy with it. Somehow I want to preserve that as much as possible (except call it "ease of use" :)) while mitigating the difficulty of version control and the "(Client) WTF my site broke!?" factors of it.

Thanks for your idea!

wizonesolutions’s picture

Issue tags: +architecture

Actually, I think this is a great idea for the initial development because I can check for the existence of the function with function_exists(), and it won't require me to do anything fancy in terms of finding available functions straight off the bat. Better to start small and get more complex once there's a proof-of-concept, so again, thanks for the idea!

mikeytown2’s picture

Glad to help!

Next step would be suggested function names. Computed fields does this
http://drupalcode.org/project/computed_field.git/blob/refs/heads/6.x-1.x...

wizonesolutions’s picture

Hmm...that's not necessarily a bad idea. Suggested but not required would be good. They should be able to enter their own as well. One concern would be the overhead of checking if those functions were implemented for every PHP-controllable entity, and without a unique way of identifying nodes, perhaps it wouldn't really help that much.

Maybe detail more what you were thinking? I have used Computed Field before, so I get the general concept. Curious what you thought in terms of the potential implementation.

wizonesolutions’s picture

Title: textfield for function name » Implement text field for function name in Rules

OK! So re-thinking this (#1185346: Add PHP handler schema (or figure out configuration storage method)), my first goal will be to get this working for Rules conditions and actions. This is the single best use case I can think of that's actually practical right now. Block visibility is better handled with Context. Views, with its AJAX, will probably be a pain to code for even though it's also a good use case (e.g. when using views_customfield). Nodes should never need to do this. But Rules is a place where a bit of PHP often makes sense.

I could do this via a filter, but that still leaves things too open-ended...and it makes me write a filter :D so I'm gonna start like this.

wizonesolutions’s picture

Category: feature » task