On the settings page of the freelinking module, one can restrict free links to choosen content types. The variable is stored as an array. Finaly the _freelinking_exists() function gets the variable and is supposed to build the query to search for the right node to link to. However, the 'where' clausule is not added to the query. Here comes the fix.
$noderestrict = variable_get('freelinking_restriction', NULL);
if (isset($noderestrict) && $noderestrict['none'] =! 'none') { // need to add the where clause
Fix:
$noderestrict = variable_get('freelinking_restriction', array('none'));
if (is_array($noderestrict) && !in_array('none', $noderestrict)) { // need to add the where clause
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | freelinking-restriction.patch | 1.04 KB | toemaz |
Comments
Comment #1
toemaz commentedFind the patch attached. The patch is running in production on http://musescore.org/en/handbook
Comment #2
Kripsy commentedI can confirm this fixes the problem.
Comment #3
toemaz commentedThx for kicking in. What I find rather strange is that no one else has this problem. Or nobody cares about the problem.
Comment #4
Kripsy commentedWell, it relies on content across different node types having the same title and then being hyper linked and even then would depend on the node type weight for someone to notice. I just don't think most people run into this case a lot but on a wiki style site that also has media and forum topics like mine it happens A LOT so I noticed pretty quickly. :)
Comment #5
toemaz commented@Krispy
Add to this that my setup is multilingual as well and the stress test for the freelinking module is complete. I have one other outstanding but solved freelinking issue which waiting to be committed for almost half a year. Hopefully this one can be committed a bit faster.
Comment #6
toemaz commentedPatch has been applied to 6.x-1.x as well as 6.x-2.x