Hi Eric,
As suggested here is the patch for the changes i have made for checking on self embedding and circular referencing of embedded nodes.
Essentially a recursive check is performed on each CCK field (if it exists) and Body if they are filtered with a "Insert Node"/Node Embed filter to see if the same embedded node exists.
If so an error if is presented in the node edit form.
Also for our purposes we wanted to be able to add in key:value pairs with the embedded node to pass on parameters. (ie [[nid:xxxx key1:value1 key2:value2 ... ]] )
If the user does not want this then it will still use the standard [[nid:xxx]] format.
I have also tweaked the regular expression search to take into account spacing.
Mark
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | node_embed.-6.x-1.3.patch | 11.48 KB | mcorbenster |
| #1 | node_embed.-6.x-1.1.patch | 15.74 KB | mcorbenster |
| node_embed.patch | 16.26 KB | mcorbenster |
Comments
Comment #1
mcorbenster commentedSorry try this patch instead!
Comment #2
mcorbenster commentedI am supplying a patch for 6.x-1.3 which addresses the exhausted memory error.
When a node is attempted to be embedded this patch performs a search of all nodes which have an embedded node to verify that the there is no Circular Referencing, as well as an attempt to embed a node in itself.
ie node 177 attempts to embedded node 132 which has embedded node 145 which has embedded node 177.
An error is produced informing the user of the attempt.
This therefore ensures that there is no accidental entry of a node to cause circular referencing and more importantly create an exhausted memory error.
Essentially a recursive function _valid_embed_reference() will check all nodes associated with the embedded to verify there is no circular referencing.
Checking is also made not only on the standard body text for a drupal node but also any CCK fields used for content entry.
The node_embed token format has also been extended to associate parameters with the embedded node.
It would be appreciated if you could consider this patch as it does address the exhausted memory error to make this a more stable module.
Comment #3
zxaos commented+1 to this still being an issue - I just ran into this on the D7 version of the module.
It can be a difficult to debug problem, since in my case it was causing cron to fail when indexing the circular reference, which had the net effect of causing the entire site to fail to load once every 15 minutes or so when a page request spawned a cron run (since cron hadn't run in a long time because it kept failing).
Any sort of anti-cycle fix would be highly helpful.
Comment #4
mrharolda commentedAs of 22 September 2014, we no longer support the Drupal 6 version of Node Embed due to the small install base (< 15%) and more importantly: general lack of time.
If you would like to help and maintain the 6.x branch until Drupal 8 is released, please apply for co-maintainership!
Comment #5
mrharolda commented-duplicate comment-