Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

$result-variable-undefined-given-default-value #9277

Merged
merged 2 commits into from
Aug 14, 2016

Conversation

flash1452
Copy link
Contributor

@flash1452 flash1452 commented Mar 2, 2016

Pull Request for Issue #9253 .

Summary of Changes

$result redefined with a default value.

Testing Instructions

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

After the changes the error are no longer seen.

@shubhamnba2009
Copy link

From where can i enable all errors in PHP and where can i find the method onContentAfterSave().
Thanks in advance for helping.

@flash1452
Copy link
Contributor Author

onContentAfterSave() is a method in plugins/content/joomla/joomla.php file.

@flash1452
Copy link
Contributor Author

@brianteeman Please test the PR.

@RonakParmar
Copy link

Hi,

In testing instruction, mentioned that "In the front-end, add a menu item "propose an article"."
"propose an article" means I have to select "Create Article" of "Article" in menu item, correct?
If yes, then I have created a menu item and submitted an article, but without applying this patch, I got blank page, no notice or error.
I have configure Error Reporting to "Maximum".

Here is my system information:
Joomla! Version: Joomla! 3.4.8 Stable [ Ember ] 24-December-2015 19:30 GMT
Joomla! Platform Version: Joomla Platform 13.1.0 Stable [ Curiosity ] 24-Apr-2013 00:00 GMT
PHP Version: 5.4.45-3+deb.sury.org~precise+1


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/9277.

@faynt0
Copy link

faynt0 commented Aug 2, 2016

I have tested this item ✅ successfully on c177c67

Was able to reproduce the error of the undefinded variable.
Applied patch and error did not re-appear.

Tested for @icampus


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/9277.

@toxic2302
Copy link

I have tested this item ✅ successfully on c177c67

I followed your test instructions and was able to reproduce the error. However "exit()" shows me a blank page so I've added a "var_dump()" before the exit. Now I can see this error.
After installing the patch everything is fine. I have also checked the php logs from my local server. ;)

@icampus


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/9277.

@brianteeman
Copy link
Contributor

RTC


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/9277.

@joomla-cms-bot joomla-cms-bot added the RTC This Pull Request is Ready To Commit label Aug 2, 2016
@rdeutz rdeutz added this to the Joomla 3.6.3 milestone Aug 14, 2016
@rdeutz
Copy link
Contributor

rdeutz commented Aug 14, 2016

Not sure because PHPCS should complain, do we need an empty line before foreach?

@mbabker
Copy link
Contributor

mbabker commented Aug 14, 2016

Yes. if/for/foreach/do/while should all have a blank line before them.

@zero-24
Copy link
Contributor

zero-24 commented Aug 14, 2016

@rdeutz please merge i can prepare a PR for fixing that.

@rdeutz rdeutz merged commit e0b0ece into joomla:staging Aug 14, 2016
@joomla-cms-bot joomla-cms-bot removed the RTC This Pull Request is Ready To Commit label Aug 14, 2016
@rdeutz
Copy link
Contributor

rdeutz commented Aug 14, 2016

done counting on @zero-24 to clean it up.

@zero-24
Copy link
Contributor

zero-24 commented Aug 14, 2016

@rdeutz #11605

wilsonge pushed a commit that referenced this pull request Aug 14, 2016
izharaazmi added a commit to izharaazmi/joomla-cms that referenced this pull request Aug 15, 2016
* re-arrayhelper-min: (2467 commits)
  Minimize JArrayHelper methods `toInteger`, `pivot`, `arrayUnique` by using Joomla\Utilities\ArrayHelper internally. Leaving (reverting from joomla#7782) other four methods as is for b/c reasons as mentioned in joomla#8455.
  remove platform include (joomla#11615)
  [GitHub Templates] Make headings bigger (joomla#11607)
  [com_contact] Make ACL core.edit.own work (PR for 11466) (joomla#11503)
  Small review on docs & code structure in JModelLegacy library classes (joomla#11057)
  Obviously, this should be an array. (joomla#11610)
  Don't manually import JPlatform anymore (joomla#10841)
  Parse preprocess rules from component routers (joomla#8986)
  Add the correct exception after 11593 merge (was waiting for that merrge) (joomla#11606)
  Add missing clean line after joomla#9277 (joomla#11605)
  Deprecate the _PROFILER global var (joomla#10845)
  Spelling errors (joomla#11604)
  Moved travis javascript bash file to build/travis like joomla#11600 (joomla#11603)
  Regression: Fix edit check in backend articles manager, always denying edit after soft deny (joomla#11511)
  [com_plugins] User not allowed to core.manage? Use 403 php custom exception (instead of a 404 JError) (joomla#11593)
  [com_newsfeeds] Make ACL core.edit.own work (PR for 11466) (joomla#11502)
  $result-variable-undefined-given-default-value (joomla#9277)
  com_banners use exceptions. and not allowed is a 403 (joomla#11418)
  Frontend & plugins using the autoloader (joomla#10882)
  New version of PR 6788 (JText::_() Optimizations) (joomla#11235)
  ...
ggppdk pushed a commit to ggppdk/joomla-cms that referenced this pull request Aug 19, 2016
* $result-variable-undefined-given-default-value

* space-added-before-and-after-'='-operator
ggppdk pushed a commit to ggppdk/joomla-cms that referenced this pull request Aug 19, 2016
roland-d pushed a commit to roland-d/joomla-cms that referenced this pull request Sep 11, 2016
* $result-variable-undefined-given-default-value

* space-added-before-and-after-'='-operator
roland-d pushed a commit to roland-d/joomla-cms that referenced this pull request Sep 11, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

10 participants