Download & Extend

PHP callback function option for title generation

Project:Automatic Nodetitles
Version:7.x-1.x-dev
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:active

Issue Summary

We all know that putting PHP code in the database is icky, scary, security hole, performance problem, featurization problem, and so forth. OK, cool.

The computed_field module, offers the ability to fill in a magic function name that will get used in place of whatever is filled in using the UI. The format is fixed, and is based on the field name. It's also listed in the UI for easy copy and paste. If that function is found, then the UI for setting the computing logic is hidden entirely in favor of that callback function.

The advantages of this approach are
1) You can use a real code editor.
2) Bugs in the code don't instantly break your site without the ability to fix it.
3) Code in a custom module is version controllable, doesn't need features, etc.
4) People without code-editing access cannot go changing logic on you from the UI.
5) It's easier to document.

All of those benefits would apply to auto_nodetitle, too. I'd much rather use that approach than editing PHP directly in the UI (for those title patterns too complex for tokens, like if there's a conditional). So, consider this a feature request for such an option.

nobody click here