Version: 3.5.15 Reporter: quispiam —
This is an archived bug report. If you are experiencing a similar issue, upgrade to the latest release and if that does not solve the problem, submit a new bug report
If a user wishes to edit a template and they are not a super admin EE throws an exception “No such method: filter’. This appears to be because of an incorrect call to Builder->first() before adding the final filter chain if the user has assigned groups.
I traced it to the following file;
EllisLab\ExpressionEngine\Controller\Design\Design.php in the function “manager”
Line: 108
$group = ee('Model')->get('TemplateGroup')
->fields('group_id', 'group_name')
->filter('group_name', $group_name)
->filter('site_id', ee()->config->item('site_id'))
->first();
if ($assigned_groups)
{
$group->filter('group_id', 'IN', $assigned_groups);
}
should possibly be:
$group = ee('Model')->get('TemplateGroup')
->fields('group_id', 'group_name')
->filter('group_name', $group_name)
->filter('site_id', ee()->config->item('site_id'))
if ($assigned_groups)
{
$group->filter('group_id', 'IN', $assigned_groups);
}
$group = $group->first();
Cheers
Matt.
ExpressionEngine implements Markdown Extra and BBCode. Please see the Markdown Extra docs and the BBCode Wikipedia article for a full reference.
**bold**
, __bold__
, *italics*
, _italics_
, ~strike/del~
, `code()`
bold, italics, strike/del, code()
Link: [link title](https://example.com)
Image: ![alt text](https://example.com/image.jpg)
[blockquote]...[/blockquote]
, [quote]...[/quote]
, and Markdown style:
> Some quoted text. > > This is all one quote.
[code]...[/code]
, and you can also specify the language for syntax highlighting, [code=php]...[/code]
GitHub flavored Markdown code fences are also supported:
``` public function decoderRing($str) { return str_rot13($str); } ```