Hi,
I'm wondering if nobody else had the same problem: In my installation, the nodetype settings in the administration menu are ignored and every nodetype gets an annotation form field.
Therefore, I changed the code to make it work as it should, added comments and attached the modified module file to this post.
Thanks,
Oli
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | annotate.tgz | 2.15 KB | olio |
| annotate.txt | 6.62 KB | olio |
Comments
Comment #1
olio commentedAnswering my own support request: I fixed this issue with three small changes - and a closer look at other modules demonstrating 'best practices' for the same task (in this case, the great 'nodeprofile' module, thanks to it's author!).
To share with the community, I decided to post my solution:
My approach was to not store nodetypes checked as annotation node types (that is, when the annotation checkbox on the content type form was checked and a variable was stored) in an array, but in single variables and to use a small helper function that checks if a nodetype is such an "annotation node type" . Now everything works fine for me and the module does what it should do only for the marked content types.
Here come the modifications, the old code commented out, followed by the replacement code:
1. change: the admin settings form/ annotate_admin_settings()
2. change: hook_nodeapi()
3. change: a small helper function checking if a specific content type should show an annotation field or not.
@Kermitus: Maybe you could have a look at my small solution and decide if it's a possible way to go for the next release ?
And for the other users who can't wait anymore, here's an intermediate solution until the official release is ready (I attached my modified version of the module. I didn't changed anything else in the module, so simply replace the original one with this one and install the update module to get informed as soon as an official release is out.)
Comment #2
clemens.tolboomSorry that I first fixed it and then reviewed your solution. Good to change the title too!!!
The is_object( $type) ... is nice to know. It has one drawback in that it creates a lot of variables in the variables table.
Hope my solution in the September 21 release is doing the same functionality.
Regards, Clemens
Comment #3
clemens.tolboomComment #4
(not verified) commented