$string['groupmembersonlyerror'] not used in Moodle 2?

$string['groupmembersonlyerror'] not used in Moodle 2?

by Joseph Rézeau -
Number of replies: 4
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

In Moodle 1.9, that string was used in moodlelib.

In Moodle 2.x, that string is still present in lang/en/group.php but it is not used anywhere in moodle core. I expect the reason is that modules are expected to test group membership in such ways that the 'groupmembersonlyerror' warning is no longer necessary.

Can developers confirm my findings? Do any add-ons developers actually use that string?

Joseph

Average of ratings: -
In reply to Joseph Rézeau

Re: $string['groupmembersonlyerror'] not used in Moodle 2?

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

Dear Joseph,

I did a search on the whole of Moodle 2.5.2+ (Build: 20130927) on 'groupmembersonlyerror' and only found it defined as you said in 'lang/en/group.php' - so it could be removed - perhaps with an advanced warning notice to developers.

I think that core takes the view that anything in core is subject to change and plugin's should follow it with core not 'pandering' to plugins.

Cheers,

Gareth

In reply to Gareth J Barnard

Re: $string['groupmembersonlyerror'] not used in Moodle 2?

by Anne Krijger -

While it may be true that the string is no longer used...

...searching and not finding on 'groupmembersonlyerror' is not a definate enough finding to come to this conclusion.

The string may be used with double quotes,
or even concatenated by a couple of variables;

$warning = get_string($grptype . $grprole . $grplimit . $grperrormsg);

which would be near to impossible to find as being a reference to groupmembersonlyerror.

Anne.

In reply to Anne Krijger

Re: $string['groupmembersonlyerror'] not used in Moodle 2?

by Joseph Rézeau -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

Anne "The string may be [...] concatenated by a couple of variables;"

I doubt it. Do you have any concrete examples of such concatenations in moodle core files?

Joseph

In reply to Joseph Rézeau

Re: $string['groupmembersonlyerror'] not used in Moodle 2?

by Anne Krijger -

Hi Jospeh,

Just to be clear; I concur that 'groupmembersonlyerror' may not be used anymore.

But concatenations of strings do[es] happen quite a few times.
I ran a simple search for get_string($ and that alone already gave 256 hits.
Nothing compared to the 15717 hits for get_string( but still enough to make it hard to be a 100% certain a specific string is no longer used.

None of the 256 hits had a reference to the group component, making it extremely likely that the string is no longer used, but still can't make a definite call.

Anne.

Average of ratings:Useful (1)