Needs review
Project:
Attached Node
Version:
4.7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
10 May 2007 at 08:19 UTC
Updated:
21 Jan 2008 at 05:43 UTC
Jump to comment: Most recent file
Comments
Comment #1
tinthing commentedI gave this a try because I'd really like to be able to embed nodes (e.g. image nodes whose body text is a key for the image) within a main story. It *almost* works, but there are a couple of nasty faults (can't tell if they are related). I've not used drupal versions prior to v5 so can't compare how well this module works under v4 releases.
The problems I get are:
The following error message after submitting any change once the module is enabled -
An embedded image node with a plain HTML body with a table (it's a parts diagram and matching key) is displayed with a thumbnail, but the div block it appears in isn't closed properly, leading to all the remaining page text appearing withing the block, with the table data at the end - very mashed :-(
The trouble probably all stems from the SQL error, but I'm not knowledgable enough about drupal internals to track it down.
Comment #2
pobster commentedThat's unlikely to be connected to this module I'd have thought. Line 172 is within a helper function for db_query and I'd have thought the error stems from the strange '1' in the query. Attached_node doesn't have any database associated with it, so to hazard a guess... Do you perhaps store your table in the database? Does the node you're trying to embed contain any custom php? I'm afraid I'll need to know a whole lot more before its evident where the problem lies...
Pobster
Comment #3
tinthing commentedYes, I would have thought so too. I've not got a particularly exotic set of additional modules, but started again from scratch to reproduce the problem. Here's the setup:
My guess is that there is something going wrong when the input filters are applied. Any ideas?
cheers
Comment #4
pobster commentedI wouldn't have thought that was causing the error as I mentioned before attached_node doesn't do any db_queries at all?
And here's a live site with it working just fine for me; http://www.ciclosuno.com/node/685
Hmmm... I take it that your site being 'localhost' isn't online then? So I couldn't take a look myself at what's going on?
Pobster
Comment #5
tinthing commentedNo, the site isn't online - it's as I described, a vanilla drupal install with just attached_node added.
Having gone grepping, it seems that the source of the bad SQL is the clear_cache_all() function in cache.inc:
Almost the last line of the file is where the "DELETE FROM .. WHERE cid = .." query appears. This function is called by attached_node.module here:
I'm not sure what this is trying to do, but the parameters being passed don't seem to line up with those expected by the function. Commenting it out stops the error but (obviously) no longer does what was intended either.
Any help?
Comment #6
pobster commentedAha! Yes, well found :o) Of course, this isn't affecting me as I don't use the cache - just change it to the new drupal 5.x api, so something like...
My reasoning for losing the wildcard = TRUE is that now as the caches are separate, you *can* just completely empty the filter table, whereas before the function was emptying out 'filter****' matches (so effectively the same thing).
Pobster
Comment #7
tinthing commentedYup, that's much better!
My other issue with duff HTML appears to be caused by the point at which the teaser block is cut - my embedded image node has a plain HTML table in the body text, but it's getting cut off after a few rows. If I put
at the end of the body text then the page rendering works fine. So, things are starting to look good.
My remaining issue is that filter text like [node:20,res="original"] doesn't seem to give me a full size image, just the thumbnail. Am I doing this right? Seems to be as described in the help, although when I look at the attached_node help page where it lists the parameters which can be overridden for each node type, none are listed.
cheers
Comment #8
pobster commentedI'm afraid that was an issue before and well... I didn't write the module so it's not something I'm particularly qualified to answer...
...But I will anyway ;o)
The 'break off' point is always a problem when you're using filters no matter what they are, that kind of behaviour is expected I'm afraid. What you're doing is the best way to 'counter' its action though.
Now the res part... This *does* work but you need to fiddle a little... According to the module you need to go to; (eg) admin/filters/3/configure and add the valid parameters here for each node type but... Submitting them doesn't 'take'... So... Manually alter your db (variable) find 'attached_node_allowed_vars_image' and enter
s:3:"res";as the value. Should now work... I can't really debug this as it shouldn't actually be causing any problems as far as I can tell?Pobster
Comment #9
tinthing commentedAh, OK I hadn't twigged that you have to configure the filter with the params to be allowed. Having added title,res,width I can use [node:20,res="original",title="foobar"] and get just what I expect. Can't seem to get any difference when trying to specify a width though.
I didn't have to go fiddling with the database to get this to work. However, I have had problems elsewhere in filter config with settings not being applied. E.g. I added some extra HTML tags to the HTML filter and found that they didn't 'take' when saving settings from the Configure form, but *did* if I then switched back to the View form and saved there too.
Getting width to work would make this module perfect - extremely useful for layouts of more elaborate articles. Can achieve the same effect by editing the CSS, but of course that's global.
Comment #10
Duncan Pierce commentedNice work.
I've rerolled the patch with the cache fix and added the module info file needed by Drupal 5.x. Seems to work for me.
Comment #11
TomChiverton commentedI can confirm the 4.7 attached_node, patched as per this issue, runs fine on 5.2.
This should be pushed out.
Comment #12
shane commented+1 for rolling this out as a package - I upgraded from 4.7.7 to 5.2 and patcher per this node info, and it works fine.
FYI - I WOULD love to see attached_node ported to 6.x as well - I'll be rolling to 6.x ASAP - and I dearly rely on the attached_node - I think attached_node should be a part of core ... It's one of those "duh" modules, the ability to include chunks of text into other nodes. Take a "news" page for example, each news article gets a footer with "About ... " information on the company ... just create a node and include it - BOOM! Done! Thanks for listening. Thanks for maintaining the code!
Comment #13
pobster commentedI'll do it when I need it, I rely heavily on this module.
Pobster
Comment #14
David_Rothstein commentedThere is a new module available for 5.x which more or less does the same thing as Attached Node:
http://drupal.org/project/InsertNode
It might be a good idea to do any new development there, seeing as how Attached Node looks like it's near death... ;)