Skip to main content
Manage Membergroups fatal error on Members.subs.php Started by AaronB · · Read 2760 times 0 Members and 1 Guest are viewing this topic. previous topic - next topic

Manage Membergroups fatal error on Members.subs.php

In the Manage Membergroups>Group Members>Add a member to this group; when a member is added the following error is generated

Fatal error: [] operator not supported for strings in /home/elkarte/public_html/sources/subs/Members.subs.php on line 1475

That error is from a live test site, with the beta install package and with the master package files copied over.

If the site has only the beta install package, the error is on line 1432. The Members.subs.php error is reproduceable on both a live test site and an Xampp localhost.

Re: Manage Membergroups fatal error on Members.subs.php

Reply #1

One of the stupid error of mines... :-[

Instead of this:
Code: [Select]
				foreach ($query_conditions as $condition => $query_condition)
{
if ($query_condition == 'member_names')
$query_parts[$condition === 'or' ? 'or' : 'and'] = $allowed_conditions[$query_condition]($query_params);
else
$query_parts[$condition === 'or' ? 'or' : 'and'] = isset($allowed_conditions[$query_condition]) ? $allowed_conditions[$query_condition] : $query_condition;
}
}
elseif ($query == 'member_names')
$query_parts[$condition === 'or' ? 'or' : 'and'] = $allowed_conditions[$query]($query_params);
else
$query_parts['and'] = isset($allowed_conditions[$query]) ? $allowed_conditions[$query] : $query;
}

try this:
Code: [Select]
				foreach ($query_conditions as $condition => $query_condition)
{
if ($query_condition == 'member_names')
$query_parts[$condition === 'or' ? 'or' : 'and'][] = $allowed_conditions[$query_condition]($query_params);
else
$query_parts[$condition === 'or' ? 'or' : 'and'][] = isset($allowed_conditions[$query_condition]) ? $allowed_conditions[$query_condition] : $query_condition;
}
}
elseif ($query == 'member_names')
$query_parts[$condition === 'or' ? 'or' : 'and'][] = $allowed_conditions[$query]($query_params);
else
$query_parts['and'][] = isset($allowed_conditions[$query]) ? $allowed_conditions[$query] : $query;
}

There are two blocks of code to replace!

If it works, I pushed the fix here:
https://github.com/emanuele45/Dialogo/commit/e2640745814340050c7024d5ab2d1d76b088b94f
Bugs creator.
Features destroyer.
Template killer.