1

I upgraded my tiki from 15.4 to 16.2. Everything runs fine. The problem is the site registration does not work. I have a tracker to extend my user information. In the tracker, I created a field called "Network" that allows the users to choose a group that them want to be in. Hence, they won't see each other content due to different group permission. This registration broke. The error message showed:

Cannot add nonexistent user xxx to group students

I found out the problem was that there is a change in trackerlib.php line 3671. Instead of returning "null", it now returns an empty array().

else {
    return array();
}

In GroupSelector.php, line 124, the condition check

if (empty ($creators))) $creators=array($user);

This if will never be executed since the function now return an array not null. Hence causing the problem that no one can be registered if they choose a group in the registration form.

Propose solution, change the if condition in line 124 to:

if (empty($creators[0]))
James Z
  • 12,209
  • 10
  • 24
  • 44
Tommy
  • 31
  • 3
  • Are you asking help here or are you somehow using your question as a bug report? – James Z Jul 06 '17 at 07:38
  • 1
    Indeed, seems a bit like a bug report and a fix is on it's way (see my comment below), so in the future the place to report bugs is https://dev.tiki.org/File-a-bug - thanks! – jonnybradley Jul 06 '17 at 14:12

2 Answers2

1

My fix has now been improved by our colleague kroky6 (thanks!) and is now in the 16.x branch, so you can test it by using the 16.x nightly tarball from here tomorrow and will be in 16.3 (and 17.0 onwards) coming soon...

jonnybradley
  • 620
  • 5
  • 6
0

Did you check the actual 16.x version (dev branch) of this file (lib/core/Tracker/Field/GroupSelector.php) ?

https://sourceforge.net/p/tikiwiki/code/HEAD/tree/branches/16.x/lib/core/Tracker/Field/GroupSelector.php

Chances are, this is fixed already. :)

Bernard

  • No, it hadn't been fixed yet, so i just (hopefully) fixed it in http://sourceforge.net/p/tikiwiki/code/63182 for Tiki 17 and will backport it to 16 if it looks ok (i couldn't reproduce it exactly) - i did it slightly differently to your suggestion to cover more types of "empty" – jonnybradley Jul 06 '17 at 14:10