Active
Project:
WYSIWYG image upload - Inline images for your WYSIWYG
Version:
6.x-2.9
Component:
User interface
Priority:
Minor
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
15 Jan 2011 at 03:16 UTC
Updated:
18 May 2011 at 16:50 UTC
Comments
Comment #1
eugenmayer commentedWell a big an major issue is really something else :)
As the iid relation table is used, there is way of having dublicates. How to get rid of those using views will be the task here
Comment #2
nbchip commentedDistinct feature set in Views is not doing its job, or i think its not...
Maybe there is need for some intervention in form of views_pre_view hook.
Comment #3
eugenmayer commentedviews is missing this feature by default, yes.
Comment #4
nbchip commentedActually it selects distinct but on wrong field
SELECT DISTINCT(iid) , should be SELECT DISTINCT(wysiwyg_imageupload_entity.fid)
When i rewrite SQL it works (DB is database name)
I tihnk GROUP BY isnt necessary
Hope this helps somehow.
Comment #5
jasonlttl commentedI don't think this view should be returning distinct fids because it really seems geared to capture instances of an image's use. Rather, I think the problem is that the view pulls in all node revisions (all past uses of an image) when most of my users are only going to care about the current revisions. I'll try to take a look at this in a little more depth in the next few days and post whatever solution I come up with.
This is the sql of the browser view.
SELECT DISTINCT(iid)
FROM
wysiwyg_imageupload_entity wysiwyg_imageupload_entity
INNER JOIN files files_wysiwyg_imageupload_entity
ON wysiwyg_imageupload_entity.fid = files_wysiwyg_imageupload_entity.fid
INNER JOIN node node_wysiwyg_imageupload_entity
ON wysiwyg_imageupload_entity.nid = node_wysiwyg_imageupload_entity.nid
GROUP BY iid
I think it needs to take into account the vid (how to do in views?) with something a little more like this.
SELECT DISTINCT(r.iid)
FROM
wysiwyg_imageupload_entity wysiwyg_imageupload_entity
INNER JOIN files files_wysiwyg_imageupload_entity
ON wysiwyg_imageupload_entity.fid = files_wysiwyg_imageupload_entity.fid
INNER JOIN node node_wysiwyg_imageupload_entity
ON wysiwyg_imageupload_entity.nid = node_wysiwyg_imageupload_entity.nid
INNER JOIN wysiwyg_imageupload_entity_revision r
on r.vid = node_wysiwyg_imageupload_entity.vid
and r.iid = wysiwyg_imageupload_entity.iid
GROUP BY iid
By the way, thanks for the work on this module. The examples for how to extend it are fantastic.
Comment #6
eugenmayer commentedThanks Jason.
Its pretty sure that the query is the issue, just because of the joins and the base-table. I was not able to work on the module for longer time already, just to busy with other stuff. So if someone wants to help, just go forward
Comment #7
nbchip commentedI agree that it not useful to show past revision images, still i think there should be option to also show only one instance of same image.
Main use case is browsing for images for insert and seeing same images is pointless.
Comment #8
eugenmayer commentedI completely agree. Thats simply a bug :)
Comment #9
jasonlttl commentedYeah, I agree with nbchip in #7 too. Initially I was only thinking about nodes and not comments (or blocks or panels widgets - currently unsupported).
I may take a look at both this and the blocks/panels issue within the next week or so. My guess is, if that one's going to be solved it will need to be solved first as the use of blocks or panels (or comments maybe) has implications with respect to what shows in the browser. IE, if blocks/panels are supported, the browser can't tie back to a node. I'll try and generate some patches in both issues and submit them for Eugen's review.
Comment #10
eugenmayer commentedThats exactly the issue jason. Currently we only support nodes as entities ( vid / nid ) what enables us to work with permissions and access and all this.
The issue is, i did not design this "openly", means, that you cant add new entites by an API, we have to rewrite the db-scheme to use a relation for the entity. Then, we need to talk about how to work with permissions, so respect them if entities are nodes ( node access ) and ask, by using an API, what kind of "block" permissions there are. Yet, i guess blocks are then readable by all, though all images can be used, and so forth ( can be extended later ).