It starts with a user creating node X (uploading an image) and then users create comments for node X.

If users reuse the image from node X in the comment, the image data of the node image gets updated with the comment id.
This leads to the situation that properties for the original node change!

Instead a new record should be added and the original record should remain with cid=0.

Comments

miro_dietiker’s picture

Priority: Normal » Critical
StatusFileSize
new32.54 KB

After some more testing:
Reusing an image leads in current version always to reusing the same iid. Thus settings get overwritten.
Tested with wui.make for nodes and comments.

Note that the table wysiwyg_imageupload_entity contains broken lines after each insert. (See attachment)
The first broken lines comes from a second image use in the node, while the second broken line comes from a third image use in the node's comment comment.

This breaks wysiwyg_imageupload critical in my understanding.

miro_dietiker’s picture

Hmm...
While debugging i found some related issues.
I see that even if we trivially fix the above:
When using an iid in the markup that is from a different node/comment (by manually inserting tags), you
- can load the data in the dialog from a different (possibly inaccessible) node
- the line gets updated with the current comment id (even if it was a node before!)

Thus save should be limited to the current node / entity as detected. Foreign elements should be suppressed.
Check in case of node entity for cid=0.

If we correct the above right this will go away.

eugenmayer’s picture

Thanks for the debugging Miro and the help. Merged your fix https://github.com/EugenMayer/wysiwyg_imageupload/commit/ade918c2347045b...

eugenmayer’s picture

Status: Active » Fixed
miro_dietiker’s picture

Priority: Critical » Major
Status: Fixed » Needs work

Eugen, what can we do regarding my additional comments?
New issues to open?

eugenmayer’s picture

You mean for the ghost-lines?

I think we should keep this issue for the "reuse issue". The other might be related ( even should, because there is a ghost line created when you look a the bug... and the relation is never attached. So one ghost line should be gone, are there even more?)

If you test it, seperate the tests by node and comments. I tested the node behavior pretty much, but comments rather only some major tests. Maybe some unseen issues still hide there.

eugenmayer’s picture

Status: Needs work » Fixed

As we talked about, (that) issue is closed :)

eugenmayer’s picture

Status: Fixed » Closed (fixed)

released with 2.9