Ce sujet a été marqué résolu par Arantor, le 7 Octobre 2012 à 16:31

Farjo

  • "a valuable asset to the community"
  • Messages: 492
Error message on search
« le 3 Octobre 2012 à 15:44 »Modifié le 3 Octobre 2012 à 16:43 par 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:
Citation
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
  • Messages: 16 082
Re: Error message on search
« Réponse #1, le 3 Octobre 2012 à 16:19 »
(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.
  • Messages: 14 278
Re: Error message on search
« Réponse #2, le 3 Octobre 2012 à 19:32 »Modifié le 3 Octobre 2012 à 19:48
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
  • Messages: 16 082
Re: Error message on search
« Réponse #3, le 3 Octobre 2012 à 23:46 »
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.
  • Messages: 14 278
Re: Error message on search
« Réponse #4, le 3 Octobre 2012 à 23:57 »
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
  • Messages: 16 082

Arantor

  • As powerful as possible, as complex as necessary.
  • Messages: 14 278
Re: Error message on search
« Réponse #6, le 4 Octobre 2012 à 17:21 »
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
  • Messages: 16 082
Re: Error message on search
« Réponse #7, le 4 Octobre 2012 à 17:57 »
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.
  • Messages: 14 278
Re: Error message on search
« Réponse #8, le 4 Octobre 2012 à 18:02 »
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.