My favorites | Sign in
Project Home Downloads Wiki Issues Source
READ-ONLY: This project has been archived. For more information see this post.
Search
for
  Advanced search   Search tips   Subscriptions
Issue 150: [filen] replacement for content_nodes doesn't work
1 person starred this issue and may be notified of changes. Back to list
Status:  Fixed
Owner:  ----
Closed:  Jan 2009


 
Reported by matt.g...@gmail.com, Nov 25, 2008
What steps will reproduce the problem?
1. Create a new content, for example a snippet
2. Attach an image file
3. Try to reference the image file from within the snippet using [file1]

What is the expected output? What do you see instead?

[file1] should be replaced with the path to the newly uploaded image.

What version of the product are you using? On what operating system?

1.0 I think. Linux.

Please provide any additional information below.

The fix is as follows:

@content_node.content.gsub!("[file#{files_saved}]", new_file.public_filename)

should be

@content_node.content = @content_node.content.gsub("[file#{files_saved}]",
new_file.public_filename)

It appears that rails doesn't notice that the content attribute is dirty
and needs persisting if you use the ! in place gsub.

//matt

Jan 25, 2009
Project Member #1 subim...@gmail.com
Fixed r174

Thanks for the patch. I've applied it, but please next time include a proper patch
(with tests) as outlined here:

https://code.google.com/p/substruct/wiki/ContributingToSubstruct

All tests should pass when you run "rake test:plugins:all PLUGIN=substruct"

It takes longer for me to apply these things if I have to write test code and verify
myself that things work as they should.
Status: Fixed

Powered by Google Project Hosting