? ? Failure

User tests: Successful: Unsuccessful:

avatar vtamara
vtamara
9 Sep 2015
avatar vtamara vtamara - open - 9 Sep 2015
avatar vtamara vtamara - change - 9 Sep 2015
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 9 Sep 2015
Status Pending New
Labels Added: ? ?
avatar joomla-cms-bot
joomla-cms-bot - comment - 9 Sep 2015

Please add more information to your issue. Without test instructions and/or any description we will close this issue within 4 weeks. Thanks.
This is an automated message from the J!Tracker Application.

avatar vtamara vtamara - change - 9 Sep 2015
Title
Converting TRUE and FALSE to 1 and 0. Solve #7834
Converting TRUE and FALSE to 1 and 0. Fix #7834
avatar vtamara
vtamara - comment - 15 Sep 2015

The bug that this path fixes, and some thoughts about the solution are described at #7834

I will summurize here anyway. Using the latest version of Joomla, on a PostgreSQL database and trying to edit a template you will obtain the error shown below:

error-1-duplicar-template

avatar Bakual
Bakual - comment - 15 Sep 2015

I haven't tested on PostgreSQL, but on MySQL it obviously works fine.
Inspecting $published while opening a template style also shows me that it is empty. Thus the code in question isn't fired at all.
Looking at your screenshot, it looks like you are using at least some 3rd party plugins or even a template with a framework. Which makes me believe the issue is caused from there.
That $published variable should contain an array of integers with the values of the states to be filtered. Passing true or false would be wrong values.

If you want to sanitise it, you may instead use $published = JArrayHelper::toInteger($published) which will cast the values to integer and remove any non-integer values. Making the code much easier to read.

avatar alikon
alikon - comment - 16 Sep 2015

without this pr on postgresql no problem on edit and save a "core template" without 3dp
so unable to reproduce

avatar Bakual
Bakual - comment - 16 Sep 2015

@vtamara Can you provide details with which template you had this issue? Or what the exact steps are to reproduce the issue?

avatar vtamara
vtamara - comment - 17 Sep 2015

I'm using T3 Framework with template Purity III --that announce to work on PostgreSQL

avatar vtamara
vtamara - comment - 17 Sep 2015

Using $published = JArrayHelper::toInteger($published) instead of the filter I proposed gives the following error:

jarrayhelper_tointeger

avatar vtamara vtamara - change - 17 Sep 2015
Title
Converting TRUE and FALSE to 1 and 0. Fix #7834
Converting TRUE and FALSE to 1 and 0 when editing Purity III template. Fix #7834
avatar Bakual
Bakual - comment - 17 Sep 2015

Ah, that may be because you end up with all invalid entries in the array and thus implode on an empty array.

We could add a check to see if the array contains anything after it's passed through the JArrayhelper. But honestly I think it's a bug in the T3 framework which should be fixed by them, they seem to pass "true" instead of "1".
We can (and should) sanitise the input on our part, but fixing the issue is their job.

avatar vtamara vtamara - reference | 0b4ceea - 17 Sep 15
avatar vtamara
vtamara - comment - 17 Sep 2015

Thank you. Confirmed it is a T3 issue I'm proposing solution there and closing here.

t3framework/t3#423

avatar vtamara vtamara - change - 17 Sep 2015
Status New Closed
Closed_Date 0000-00-00 00:00:00 2015-09-17 14:41:54
Closed_By vtamara
avatar vtamara vtamara - close - 17 Sep 2015

Add a Comment

Login with GitHub to post a comment