Wedge
Public area => Bug reports => The Pub => Archived fixes => Topic started by: Farjo on October 3rd, 2012, 03:44 PM
-
Noticed this yesterday - if you search for something, and you get one result or more, across the top of the screen is displayed this:
Notice: Undefined index: topicsolved_any in /wedge/Plugins/topic_solved/src/TopicSolved-MessageIndex.php on line 61
Warning: in_array() [function.in-array]: Wrong datatype for second argument in /wedge/Plugins/topic_solved/src/TopicSolved-MessageIndex.php on line 61
-
(Simplified your path :P)
We're aware of that bug, it shows up in the error log everytime someone does a search, it was discussed in a more general topic, but unfortunately I'm not sure whether it's been fixed yet. Pete did some changes to the permission system vs plugins AFAIK, and it had an impact on boardsAllowedTo(), and I thought he fixed it recently but apparently it's not the case...
-
Smells to me like Security.php isn't patched up to date with the SVN trunk version, since I can no longer reproduce this on my local site even as a non-admin.
Or that the version of the plugin is not necessarily the most recent... I did change the code there too but for something else.
-
Security.php is definitely the latest here.
topic_solved is the latest as well... At least out of what's on the svn!
-
Huh, if it's the latest from both trees, I see no reason why it shouldn't work! But I'll investigate when I'm done with what I'm doing right this moment.
-
Sure, that's no biggie.
-
It was a bug in the plugin itself calling the permissions function wrong and as a result getting a meaningless response back.
-
Good then, I've uploaded the new version and it doesn't trigger the error any more. :)
-
Fantastic.
In case anyone was wondering what the hell was going on, boardsAllowedTo operates in two ways.
If you give it a string, naming a permission, you get an array of boards back where the user has that permission in (except admins get an array containing board id 0 back, for every board)
If you give it an array of names of permissions, you get an array back, the keys being the permission names and the contents of each of those being the same as above.
Except I hadn't actually told boardsAllowedTo that it was an array, it thought it was getting a string, but the rest of the plugin expected the contents as if boardsAllowedTo had had an array >_< Subtle but awkward.