This topic was marked solved by Arantor, on October 7th, 2012, 04:31 PM

Farjo

  • "a valuable asset to the community"
  • Posts: 492
Error message on search
« on October 3rd, 2012, 03:44 PM »Last edited on October 3rd, 2012, 04:43 PM by Nao
Noticed this yesterday - if you search for something, and you get one result or more, across the top of the screen is displayed this:
Quote
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

Nao

  • Dadman with a boy
  • Posts: 16,082
Re: Error message on search
« Reply #1, on October 3rd, 2012, 04:19 PM »
(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...

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Re: Error message on search
« Reply #2, on October 3rd, 2012, 07:32 PM »Last edited on October 3rd, 2012, 07:48 PM
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.
When we unite against a common enemy that attacks our ethos, it nurtures group solidarity. Trolls are sensational, yes, but we keep everyone honest. | Game Memorial

Nao

  • Dadman with a boy
  • Posts: 16,082
Re: Error message on search
« Reply #3, on October 3rd, 2012, 11:46 PM »
Security.php is definitely the latest here.
topic_solved is the latest as well... At least out of what's on the svn!

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Re: Error message on search
« Reply #4, on October 3rd, 2012, 11:57 PM »
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.

Nao

  • Dadman with a boy
  • Posts: 16,082

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Re: Error message on search
« Reply #6, on October 4th, 2012, 05:21 PM »
It was a bug in the plugin itself calling the permissions function wrong and as a result getting a meaningless response back.

Nao

  • Dadman with a boy
  • Posts: 16,082
Re: Error message on search
« Reply #7, on October 4th, 2012, 05:57 PM »
Good then, I've uploaded the new version and it doesn't trigger the error any more. :)

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Re: Error message on search
« Reply #8, on October 4th, 2012, 06:02 PM »
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.