User tests: Successful: Unsuccessful:
This is a redo of PR #7840 made by @ryandemmer
It is possible, under certain circumstances (for example when JForm::getFieldset is called), for JFormFieldCaptcha to be initiated in the Joomla Administration. This causes a fatal error as JFactory::getApplication()->getParams() (called on line 94), is not available in JApplicationAdministrator.
Line 88-89 added in this PR ends the setup process in this case.
I don't know of a use case for captcha in the Joomla Admin, but if there is one, then
JFactory::getApplication()->getParams()->get('captcha', JFactory::getConfig()->get('captcha'));
needs to be altered accordingly.
This is difficult to test as the error occurs in few circumstances, but was noticed in JCalPro following a recent JCE update which included a system plugin that uses JForm::getFieldset to get a list of all JFormField elements loaded. When editing a JCalPro Event, the form can include a captcha field in the front-end. When editing the Event in JCalPro in the Joomla Admin, the captcha field is not used, but JForm::getFieldset will still initiate it, resulting in the error described above.
A test could be created using the Joomla Article Manager by adding the following field to /administrator/components/com_content/models/forms/article.xml:
<fieldset
name="captcha"
label="Test Captcha"
>
<field
name="captcha"
type="captcha"
label="Test Captcha"
description="Test Captcha"
validate="captcha"
/>
</fieldset>
Then creating or editing an article with the latest version of JCE installed.
Status | New | ⇒ | Pending |
Labels |
Added:
?
|
Rel_Number | 0 | ⇒ | 7840 |
Relation Type | ⇒ | Pull Request for |
Category | ⇒ | Plugins |
This PR has received new commits.
CC: @brianteeman
Roland,
The code is perfectly well in place. See
http://screencast.com/t/OJEz9rUmsDG as proof. It is not placed in the template at all as you can see from the screencast. Nicely in the file as instructed but with the result as shown
On 3/16/2016 2:25 PM, RolandD wrote:
@gwsdesk https://github.com/gwsdesk Not sure where you added the XML
code in the template but in the instructions it is suggested to put it
in the article.xml. However what you see seems to indicate the patch
is not in place as this is what happens without the patch.—
You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub
#8657 (comment)
Leo can you please turn up error reporting to development - I'm sure there is another fatal error somewhere - and need to see where :) thanks!
@gwsdesk can you reply to @wilsonge question please
I have tested this item successfully on e2b2586
Retested with current staging and current JCE release (2.5.16) confirmed fatal error
Applied patch and all good
Easy | No | ⇒ | Yes |
I have tested this item unsuccessfully on e2b2586
I am receiving a Fatal Error when trying to save a new article.
Fatal error: Call to undefined method JApplicationAdministrator::getParams() in /Applications/MAMP/htdocs/j3_githubtesting/libraries/cms/form/rule/captcha.php on line 38
Steps I took...
This PR has received new commits.
CC: @brianteeman, @justinherrin
@justinherrin That was a good test, I was able to check it and reproduce it. The latest change should solve the issue you found.
I have tested this item successfully on 324dde0
Much better now
I have tested this item successfully on 324dde0
Tested it without JCE. Just put the XML
<fieldset name="captcha" label="Test Captcha" >
<field
name="captcha"
type="captcha"
label="Test Captcha"
description="Test Captcha"
validate="captcha"
/>
</fieldset>
inside the attribs fields, for example after line 610 in the article.xml file.
Status | Pending | ⇒ | Ready to Commit |
Labels |
Added:
?
|
Milestone |
Added: |
Maintainers. Please hold on merging this until I talk to Roland about this tomorrow. Thanks
This PR has received new commits.
CC: @brianteeman, @justinherrin, @laoneo
Much better now! Thanks!
Status | Ready to Commit | ⇒ | Fixed in Code Base |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2016-05-08 11:37:06 |
Closed_By | ⇒ | Kubik-Rubik |
Labels |
Removed:
?
|
I have tested this item successfully on aefbee5
This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/8657.