No Code Attached Yet J3 Issue
avatar conflate-nl
conflate-nl
24 Aug 2017

Steps to reproduce the issue

In the model of a component singular item, is a function called getForm which calls the parent function loadForm with the options to create a JForm object. The function getForm has a param loadData which defaults to true. When this function is first called with loadData set to false, and then called with loadData set to true, the JForm is returned without any data. There's a change whitch removes the setting for loading data when creating a signature, and then returns any previously loaded forms. The new code has this comment in file libraries/legacy/model/form.php ln 203:
// Create a signature hash. But make sure, that loading the data does not create a new instance
$sigoptions = $options;

I get the fact that we can use the previously created JForm, but now the entire loading of the data section is omitted, thus returning an JForm object without data.

Expected result

When setting the loadData to true, the data is actually loaded, regardless if the Form was created before.

Actual result

Empty JForm object, that is the JForm object is created correctly but with no data binded, even though the option specifies it should load it.

System information (as much as possible)

Joomla 3.7.4.

Additional comments

This problem is since Joomla 3.7.4, in 3.7.3 is was working fine. The problem lies in the fact that the signature is created regardless of the load data setting, which is fine, we don't need to create a new instance if the only difference is loading data, but the option should be handled when it is set to load.
Here is the code that generates the new hash, and if it exists, returns the object straight away, without rechecking if the data should be loaded. Of course there is the clear switch, but always setting this to true to make the data get loaded, is still not utilizing the previously created object.
$sigoptions = $options;

if (isset($sigoptions['load_data']))
{
unset($sigoptions['load_data']);
}
$hash = md5($source . serialize($sigoptions));

// Check if we can use a previously loaded form.
if (isset($this->_forms[$hash]) && !$clear)
{
return $this->_forms[$hash];
}

avatar conflate-nl conflate-nl - open - 24 Aug 2017
avatar joomla-cms-bot joomla-cms-bot - change - 24 Aug 2017
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 24 Aug 2017
avatar conflate-nl conflate-nl - change - 24 Aug 2017
The description was changed
avatar conflate-nl conflate-nl - edited - 24 Aug 2017
avatar franz-wohlkoenig franz-wohlkoenig - change - 24 Aug 2017
Category Components
avatar franz-wohlkoenig
franz-wohlkoenig - comment - 25 Nov 2017

@conflate-nl can you please look at latest staging if this Issue still occur?

avatar franz-wohlkoenig franz-wohlkoenig - change - 25 Nov 2017
Status New Information Required
avatar franz-wohlkoenig
franz-wohlkoenig - comment - 26 Dec 2017

If this Issue get no Response, it will be closed at 26th January 2018.

avatar joomdonation
joomdonation - comment - 26 Dec 2017

Just want to add that this is is a valid issue (I saw it when I worked on the PR #19145)

avatar franz-wohlkoenig
franz-wohlkoenig - comment - 26 Dec 2017

@joomdonation thanks for Info, Issue stay open.

avatar franz-wohlkoenig franz-wohlkoenig - change - 27 Jan 2018
Status Information Required Discussion
avatar brianteeman brianteeman - change - 25 Mar 2018
Labels Added: J3 Issue
avatar brianteeman brianteeman - labeled - 25 Mar 2018
avatar jwaisner jwaisner - change - 11 Mar 2020
Status Discussion Confirmed
avatar brianteeman
brianteeman - comment - 23 Aug 2022

Thank you for raising this issue.

Joomla 3 is now in security only mode with no further bug fixes or new features.

As this issue doesn't relate to Joomla 4 it will now been closed.

If we are mistaken and this does apply to Joomla 4 please open a new issue (and reference this one if you wish) with updated details for testing in Joomla 4.
cc @zero-24

avatar zero-24 zero-24 - change - 23 Aug 2022
Status Confirmed Closed
Closed_Date 0000-00-00 00:00:00 2022-08-23 22:33:08
Closed_By zero-24
Labels Added: No Code Attached Yet
Removed: ?
avatar zero-24 zero-24 - close - 23 Aug 2022

Add a Comment

Login with GitHub to post a comment