Convert all PHP nodes and blocks into modules
kbahey - July 1, 2008 - 02:45
| Project: | Drupal.org customizations |
| Component: | Code |
| Category: | task |
| Priority: | normal |
| Assigned: | kbahey |
| Status: | closed |
Description
This started out in the webmasters issue queue http://drupal.org/node/222558
Removing code from content is a good idea for many reasons, such as security, versioning, ...etc.
Attached is the first batch of these modules. All of the replace blocks, except for the bingo module which replaces the contributor links module AND several nodes that redirect to a random issue/patch.
The existing contributor_links.module that I wrote on Monday June 30 and killes installed should be disabled in favor of the bingo module.
| Attachment | Size |
|---|---|
| part1.tar_.gz | 3.82 KB |

#1
#2
Note that in order to keep nodes in their existing hierarchy within the book module, some of the converted modules need the nodes to remain as nodes, but with a non-PHP format. The module will then add the output via PHP code to that node.
This is the easiest way to maintain the current way the handbook is organized but remove the code out of the nodes.
The first module to do that is the branches module. Please check the node IDs referenced in it and modify accordingly.
#3
Here is the second batch.
Again, look in nodeapi for the node IDs, and leave the text above the
<?php...
?>
#4
This is the third part.
Same comments apply for the nodeapi hook.
The searchquery page caches results every one hour, per Kieran's request.
#5
This is the fourth and last set of refactoring.
There is a list of nodes that either have no PHP in them, but they have the PHP format assigned so they cannot be changed by the doc team. There are other nodes that have some issues, and hence are not refactored.
Here is a comprehensive list of all the PHP nodes with issues in them.
22106: Uses the path admin/node, which is an obsolete path in D5
185363: not sure if this is needed. Seems like some old test code?
191407: Of what use is this node, select all profile values? Why? Seems a one off node for reporting.
312: Why would it have the help in there? Seems silly.
21945: Principles. No PHP code.
176817: Ditto (no PHP)
1025: Ditto (no PHP)
13236: Ditto (no PHP)
The following 3 are some old MySQL nodes. Not sure if they are used or not. Probably best to not use any of them either way.
47905: mysql table schema for d.o slow queries
47909: mysql explain for slow queries
59791: mysql test page (contains the dbtuning module from here http://drupal.org/cvs?commit=32115)
Finally
102003: This is used to unpublish project releases. This needs to be made into a proper module with proper role access to do this recurring task.
#6
The code is now on drupal.org.
I made two minor changes:
- use l() in the planet module
- fix the contributor's block by adding "return $output;"
Not all blocks may be correctly configured, leaving open until this has happened.
Thanks Khalid!
#7
@killes, can you add the code to the drupalorg project, so I can work on it from CVS?
Meanwhile, did you change the PHP nodes to change the filter and remove the php code?
#8
As per discussion on the mailing list, here is a module that allows execution of PHP for users with the appropriate role permissions. Kieran and Gabor are happy with this approach.
#9
Once this is live, the PHP filter can be deleted from drupal.org.
#10
This commit http://drupal.org/cvs?commit=124772 closes this issue.
#11
22106: deleted
185363: deleted
191407: deleted
312: changed to docs input format and entrusted to the docs team.
47905: deleted
47909: deleted
59791: deleted
#12
Automatically closed -- issue fixed for two weeks with no activity.