Skip to content

Plugin "content/joomla" "onContentAfterSave() Undefined variable: result #9253

@m4ucoder

Description

@m4ucoder

Steps to reproduce the issue

Enable all errors reporting in php.
Add "exit()" to the end of the onContentAfterSave() method (this is for watching the error)
In the front-end, add a menu item "propose an article".
In the front-end do log as an user which can add article.
When the article is submitted, the following error is displayed:
Notice: Undefined variable: result in /home/plambotte/Public/projets/web/joomla3dev/component-factory/plugins/content/joomla/joomla.php on line 93

Expected result

No "notice" error

Actual result

Notice: Undefined variable: result in /home/plambotte/Public/projets/web/joomla3dev/component-factory/plugins/content/joomla/joomla.php on line 93

Proposed bug resolution:

Solution #1: Adding a default value for $result on the beginning of the method
Or solution #2: Add a default value for $result before the foreach (line#75)
$result = true;

System information (as much as possible)

Additional comments

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions