Project

General

Profile

Bug #5544

Undefined class constant 'TOOL_PUBLIC' main/group/group_edit.php on line 224,

Added by Hubert Borderiou about 7 years ago. Updated about 7 years ago.

Status:
Bug resolved
Priority:
Normal
Category:
Users/Groups
Target version:
Start date:
27/09/2012
Due date:
% Done:

100%

Estimated time:
Complexity:
Normal
SCRUM pts - complexity:
?

Description

PHP Fatal error: Undefined class constant 'TOOL_PUBLIC' in main/group/group_edit.php on line 224,
Group page doens't display at all :-(

Hi,
I've got this error.
When I look in filemain/inc/lib|groupmanager.lib.php
I've got 3 constants defined (not in the class declaration)
define("TOOL_NOT_AVAILABLE", "0");
define("TOOL_PUBLIC", "1");
define("TOOL_PRIVATE", "2");

and I've got 1 constant define in the class declaration
const TOOL_NOT_AVAILABLE = 0;

As a result, it couldn't find constants GroupManager::TOOL_PUBLIC nor GroupManager::TOOL_PRIVATE

If I do a grep -ri "TOOL_PUBLIC" *, I find too
define('TOOL_PUBLIC', 'Public'); in file main/course_home/course_home.php
(used in main/inc/lib/course_home.lib.php)

So, I'll move
define("TOOL_PUBLIC", "1");
define("TOOL_PRIVATE", "2");
in groupmanager class declaration


Files

groupmanager.lib.php (65.7 KB) groupmanager.lib.php Hubert Borderiou, 27/09/2012 17:36

Associated revisions

Revision f093bfde (diff)
Added by Hubert Borderiou about 7 years ago

Fix constant declaration in groupmanager.lib.php -ref #5544

Revision d520ea28 (diff)
Added by Julio Montoya about 7 years ago

Sending my changes of this see #5544 r ea080a27a871

Revision 1b709ae2 (diff)
Added by Julio Montoya about 7 years ago

Resending Hubert's change 99ae65434b82 see #5544

History

#1

Updated by Yannick Warnier about 7 years ago

  • Status changed from New to Assigned
  • Assignee set to Yannick Warnier
  • Priority changed from Normal to Urgent
  • Target version set to 1.9.2

You've got to be kidding me... I'll re-package tonight then.

#2

Updated by Hubert Borderiou about 7 years ago

I've tested add and editing group with this file.
I didn't move all constants to class constants, because if I do this, I've got error creating new groups.
We'll have to check this if it is better (or cleaner) to have all constants as class constants (we will have to put some self:: in file too, and check othe files for the use of there constants and check if we have to add some GroupManager::)

I put it in RedMine and not in googlecode, because I'm not sure in what branch to put it.
See attached.

#3

Updated by Hubert Borderiou about 7 years ago

  • Assignee set to Yannick Warnier
  • Target version set to 1.9.2
#5

Updated by Julio Montoya about 7 years ago

there was also a fix in the fill users in a group that was removed see function GroupManager::fill_groups()

#6

Updated by Julio Montoya about 7 years ago

I sent my file

#7

Updated by Julio Montoya about 7 years ago

  • Status changed from Assigned to Needs more info
  • Assignee changed from Yannick Warnier to Hubert Borderiou
  • % Done changed from 0 to 50

I sent my file to the original state and I sent the fix of Hubert apparently there is only a comment?? line 1687

original

$complete_user_list = self :: filter_only_students($complete_user_list);

Hubert's change


//$complete_user_list = self :: filter_only_students($complete_user_list);

#8

Updated by Yannick Warnier about 7 years ago

  • Status changed from Needs more info to Assigned
  • Assignee changed from Hubert Borderiou to Yannick Warnier

OK, thanks. Re-packaging 1.9.2 now...
Hubert, please be more careful when doing merges in the future (if you have doubts, ask), because regressions are the worst kind of bugs (it just seems illogical to anybody involved because they already fixed the issue in the past and then it reappears).
Good job, Julio (in particular the level of details given). Worth of the best software developers :-)

It will have to be fixed in 1.9.4, but there's still something wrong with th groups: when uploading a document in the documents tool for the group, I can see the group folder in the general documents tool, but I can't see its content. I think neither the folder nor its contents should be visible from the general context!

#9

Updated by Yannick Warnier about 7 years ago

  • Category set to Users/Groups
  • Status changed from Assigned to Bug resolved
  • Assignee changed from Yannick Warnier to Hubert Borderiou
  • % Done changed from 50 to 100
#10

Updated by Hubert Borderiou about 7 years ago

Yes, you're right.
I did bad thing in the bad time, and in a hurry :-( (always bad)
I saw something were wrong.
Next time, I'll send an email quickly if I have some doubt.
Thanks Julio and Yannick for fixing my bug !
Kudos to you.
Regards,

Also available in: Atom PDF