? ? Pending

User tests: Successful: Unsuccessful:

avatar SharkyKZ
SharkyKZ
27 Feb 2020

Pull Request for Issue #27919.

Summary of Changes

Joomla\CMS\MVC\Controller\FormController::reload() method filters form data before storing it to user state. This is different from behavior in save() method where we store unfiltered data. Filtering data at this point causes some issues, e.g. form values disappearing if unset filter is used.

This removes filtering.

Testing Instructions

Create two or more categories.
Create a custom field for articles.
Edit an article.
Change its category.
After page is reloaded, check Hits and Revision fields.

Expected result

Values are present.

Actual result

Values are missing.

Documentation Changes Required

IDK.

avatar SharkyKZ SharkyKZ - open - 27 Feb 2020
avatar SharkyKZ SharkyKZ - change - 27 Feb 2020
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 27 Feb 2020
Category Libraries
avatar SharkyKZ SharkyKZ - change - 27 Feb 2020
Labels Added: ?
avatar ReLater
ReLater - comment - 27 Feb 2020

What's about field Modified By? OK, that it's empty after category change and reload?

Isn't it a security issue if unfiltered data, e.g. JS-<script> in MetaDescription field is saved in the UserData/Session? If I don't save the article after category change and it's reloaded with <script> tag intact, keep article open, isn't it possible to access the data somewhere else? I don't know... Just asking...

avatar ReLater
ReLater - comment - 27 Feb 2020

What's about field Modified By? OK, that it's empty after category change and reload?

Isn't it a security issue if unfiltered data, e.g. JS-<script> in MetaDescription field is saved in the UserData/Session? If I don't save the article and just reload, keep it open, isn't it possible to access the data somewhere else? I don't know... Just asking...

avatar ReLater
ReLater - comment - 27 Feb 2020

What's about field Modified By? OK, that it's empty after category change and reload?

Isn't it a security issue if unfiltered data, e.g. JS-script in MetaDescription field is saved in the UserData/Session? If I don't save the article and just reload, keep it open, isn't it possible to access the data somewhere else? I don't know... Just asking...

avatar SharkyKZ
SharkyKZ - comment - 27 Feb 2020

All of this is in line with how we handle data saving. Even the Modified By field issue (this will need to be fixed separately).

avatar ReLater
ReLater - comment - 27 Feb 2020

I have tested this item successfully on 3dadc5b


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

avatar ReLater ReLater - test_item - 27 Feb 2020 - Tested successfully
avatar zero-24
zero-24 - comment - 27 Feb 2020

hmm I'm not sure whether this is a good idea. In the save method we use validate before saving it to the user state: https://github.com/joomla/joomla-cms/pull/28103/files#diff-86b33cf8a55249ba67537358db4a53e1L714

@SniperSister please take a look here and give your advise.

avatar SharkyKZ
SharkyKZ - comment - 27 Feb 2020

@zero-24 No, we store unfiltered data in user state:

// Save the data in the session.
$app->setUserState($context . '.data', $data);

avatar jwaisner
jwaisner - comment - 28 Feb 2020

I have tested this item successfully on 3dadc5b


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

avatar jwaisner jwaisner - test_item - 28 Feb 2020 - Tested successfully
avatar jwaisner jwaisner - change - 28 Feb 2020
Status Pending Ready to Commit
avatar jwaisner
jwaisner - comment - 28 Feb 2020

RTC


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

avatar HLeithner HLeithner - change - 28 Feb 2020
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2020-02-28 08:20:54
Closed_By HLeithner
Labels Added: ?
avatar HLeithner HLeithner - close - 28 Feb 2020
avatar HLeithner HLeithner - merge - 28 Feb 2020
avatar HLeithner
HLeithner - comment - 28 Feb 2020

Thanks

Add a Comment

Login with GitHub to post a comment