Closed (fixed)
Project:
Freelinking
Version:
6.x-3.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
18 Mar 2010 at 18:03 UTC
Updated:
15 Apr 2010 at 18:00 UTC
If using Organic Groups with Freelinking Prepopulate the URL structure isn't quite correct: an extra GID value erroneously creeps in between the square brackets. For example, in 6.x-3.0-alpha3 clicking on a new node to be created currently has /node/add/wiki?edit[title]=porta%20aliquam&parent=1234&gids[123]=123 when it should be /node/add/wiki?edit[title]=porta%20aliquam&parent=1234&gids[]=123
Have attached the briefest of patches that removes the $key variable at line 73.
Comments
Comment #1
snorkers commentedAlthough patch will not deal with posting to multiple groups. Think that may be a function of OG - only allowed to pre-populate to a single group? Any thoughts?
Comment #2
Grayside commentedDoes that URL structure not work? I believe I may have purposefully done it to trick multi-group posting into working.
Comment #3
snorkers commentedCan't find a way to get a 'prepopulate' equivalent for multiple OGs. If a structure of /node/add/wiki?gids[]=123&gids[]=456 is used, only the first GID is used (ie GID=123 in this example). I may be wrong... or there's another workaround, but this is the result of my limited testing today.
Comment #4
Grayside commentedI understand.
I am asking if the unpatched code works as is. At the time I wrote it, I added the extra GID value specifically to address multiple groups. It's possible OG or Prepopulate changed and that stopped working.
If prepopulating multiple groups does not work at that point, I suggest opening a ticket in the Prepopulate queue.
Comment #5
snorkers commentedThe OG 'prepopulation' functionality is actually part of Organic Groups module itself (ie, the &gids[]=123 URL argument when creating a new node); it does not utilise the Prepopulate module.
In 6.x-3.0alpha3 the unpatched code in freelinking_prepopulate doesn't work at all regarding creating a new OG node (the 'Groups' are left empty). The multiple OG functionality won't work even if the URL structure was correct [because OG doesn't offer it in its core functionality].
I had a quick look at 3.0 dev and noticed that the the whole OG piece had vanished too from freelinking_prepopulate.
Do you want me to look at a patch against 3.0 DEV or 3.0alpha3? The assumption I'll make is that only the first OG argument will be the OG of a new node
Comment #6
Grayside commentedNew work should be against 6.x-3.x-dev. I am happy for the help.
Comment #7
snorkers commentedI had a re-look at the code and realised that a lot of functionality (including OG) had moved to freelinking_prepopulate.api.php (in 6.x-3.0-dev)... however, I get WSOD on viewing 'Freelinked' nodes with the DEV module:
Feel as though I'm currently hitting a brick wall, so going to revisit FL 6.x-1.x-dev for the moment (sorry for lack of 'help' for the moment... deadlines et al)
Comment #8
Grayside commentedClearly I have some ironing to do this weekend. Thank you for uncovering this.
Comment #9
Grayside commentedI'm not seeing this WSOD, nor am I grep'ing the function redeclaration. Returning attention to the OG.
Comment #10
Grayside commentedI have fixed the single-group prepopulation problem. As you say, multi-group is not possible at this time. (Database-driven magic aside)