? Success

User tests: Successful: Unsuccessful:

avatar pe7er
pe7er
17 May 2015

This PR fixes the Article Edit form with pre-selection of Language and Access Level.
Issue: if you want to add a lot of new articles and assign them to other Languages or Access Levels,
you've to select those manually in each new article.

Test instructions

Go to Article Manager
In back-end > Content > Articles > [Search Tools]
Set Filters for Select Category, Select Language (to something different than "All") and Select Access (to something different than "Public").

screen shot 2015-05-17 at 09 48 27

Create a New Article
Look on the right:

  • Category -> the Category that you've filtered on in the Article Manager
  • Access -> always "Public"
  • Language -> always "All"

screen shot 2015-05-17 at 09 48 27

This PR fixes the "pre-selection"

on basis of Access Level & Language filters.
After the PR the parameters on the right should show:

  • Category -> the Category that you've filtered on in the Article Manager
  • Access -> the Access Level that you've filtered on in the Article Manager
  • Language -> the Language that you've filtered on in the Article Manager

screen shot 2015-05-17 at 09 48 27

avatar pe7er pe7er - open - 17 May 2015
avatar pe7er pe7er - change - 17 May 2015
The description was changed
avatar zero-24 zero-24 - change - 17 May 2015
Labels Added: ?
avatar zero-24 zero-24 - change - 17 May 2015
Category Administration UI/UX
avatar zero-24 zero-24 - change - 17 May 2015
Status New Pending
Easy No Yes
avatar wilsonge wilsonge - change - 18 May 2015
Milestone Added:
avatar bertmert
bertmert - comment - 18 May 2015

@test Success. Hathor, too.

@pe7er Nice feature. I like it.

avatar gunjanpatel
gunjanpatel - comment - 18 May 2015

All is working fine. Great addition. Thanks Peter.


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

avatar gunjanpatel gunjanpatel - test_item - 18 May 2015 - Tested successfully
avatar gunjanpatel gunjanpatel - alter_testresult - 18 May 2015 - bertmert: Tested successfully
avatar gunjanpatel gunjanpatel - change - 18 May 2015
Status Pending Ready to Commit
avatar joomla-cms-bot joomla-cms-bot - change - 18 May 2015
Milestone Removed:
avatar joomla-cms-bot joomla-cms-bot - change - 18 May 2015
Labels Added: ?
avatar gunjanpatel
gunjanpatel - comment - 18 May 2015

Also tested successfully after code changes in variable name.


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

avatar zero-24 zero-24 - change - 18 May 2015
Milestone Added:
avatar infograf768
infograf768 - comment - 18 May 2015

Should not we pre-select language only when JLanguageMultilang::isEnabled() ?

avatar pe7er
pe7er - comment - 18 May 2015

Thank you all for testing! Thank you @Bakual for the code improvement suggestion. Well spotted! I've changed it in the PR.

@wilsonge Why was this PR added to milestone 3.5.0?
IMHO it's not a new feature:
Pre-selection was working for Category, but not for Language & Access Level. This PR fixed that issue.
Can this fix be added to 3.4.2 instead? Thanks!

avatar pe7er
pe7er - comment - 18 May 2015

Could you please explain the benefit your suggestion @infograf768 ?

IMHO it's not needed to check for JLanguageMultilang::isEnabled()

  • What if admins are creating multilingual articles for a new language, before wanting to switch on the Multilingal feature in the Language Plugin?
  • Wouldn't it be confusing for admins that the option sometimes works and sometimes not?
avatar infograf768
infograf768 - comment - 18 May 2015

What if admins are creating multilingual articles for a new language, before wanting to switch on the Multilingal feature in the Language Plugin?

This makes sense.

avatar sovainfo
sovainfo - comment - 18 May 2015

No need to waste resources, use 1 variable ($filterAttribuut) if you have to. You don't have to:

// Prime some default values.
    if ($this->getState('article.id') == 0)
    {
        $filters = (array) $app->getUserState('com_content.articles.filter');
        $data->set('catid', $app->input->getInt('catid', isset($filters['category_id']) ? $filters['category_id'] : null));
        $data->set('language', $app->input->getVar('language', isset($filters['language']) ? $filters['language'] : null));
        $data->set('access', $app->input->getInt('access', isset($filters['access']) ? $filters['access'] : null));
    }
avatar pe7er
pe7er - comment - 18 May 2015

Thanks @sovainfo !
I've implemented your suggestion.
Note that you have to put the "isset" part between brackets. I changed your
$data->set('catid', $app->input->getInt('catid', isset($filters['category_id']) ? $filters['category_id'] : null));
to
$data->set('catid', $app->input->getInt('catid', (isset($filters['category_id']) ? $filters['category_id'] : null)));
to get it working.

avatar pe7er
pe7er - comment - 18 May 2015

I've added the Status field to the pre-selectable fields. Please re-test!

Testing procedure

Go to Article Manager. In back-end > Content > Articles > [Search Tools]
Set Filters for
Select Status (something else than "Published"),
Select Category,
Select Language (to something different than "All") and
Select Access (to something different than "Public").

screen shot 2015-05-18 at 03 38 15

Create a New Article and check if the following parameters are automatically selected:
Status -> the Status that you've filtered on in the Article Manager
Category -> the Category that you've filtered on in the Article Manager
Access -> the Access Level that you've filtered on in the Article Manager
Language -> the Language that you've filtered on in the Article Manager

screen shot 2015-05-18 at 03 38 15


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

avatar joomla-cms-bot joomla-cms-bot - change - 18 May 2015
Milestone Removed:
avatar gunjanpatel gunjanpatel - change - 18 May 2015
Status Ready to Commit Pending
avatar Bakual Bakual - change - 18 May 2015
Labels Removed: ?
avatar infograf768
infograf768 - comment - 18 May 2015

Not sure about the status field, Peter. One rarely creates a new item with a different status than published. Implementing this may confuse users.

avatar pe7er
pe7er - comment - 18 May 2015

I've customers who want to create multiple new articles, but do not want to publish them right away. For such users this feature will be useful.
And IMHO it will be more consistent to have the same behavior on the "Status" filter as on the Language & Access filters.

avatar brianteeman
brianteeman - comment - 18 May 2015

Yes PLEASE on the status field

On 18 May 2015 at 10:41, Peter Martin notifications@github.com wrote:

I've customers who want to create multiple new articles, but do not want
to publish them right away. For them this feature will be useful.
And IMHO it will be more consistent to have the same behavior on the
"Status" filter as on the Language & Access filters.


Reply to this email directly or view it on GitHub
#6966 (comment).

Brian Teeman
Co-founder Joomla! and OpenSourceMatters Inc.
http://brian.teeman.net/

avatar sovainfo
sovainfo - comment - 18 May 2015

@pe7er Strange, worked for me without them. w8.1 xampp 1.8.1 PHP 5.4.7

To be consistent, any field that makes sense. Don't consider other fields of the filter making sense.

@test Still OK

avatar jneubauer jneubauer - test_item - 18 May 2015 - Tested successfully
avatar brianteeman brianteeman - alter_testresult - 25 May 2015 - sovainfo: Tested successfully
avatar brianteeman
brianteeman - comment - 25 May 2015

Two goo tests of the final version of the code - setting RTC - thanks all


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

avatar brianteeman brianteeman - change - 25 May 2015
Labels Added: ?
avatar brianteeman brianteeman - change - 25 May 2015
Status Pending Ready to Commit
avatar infograf768
infograf768 - comment - 29 May 2015

$data->set('language', $app->input->getVar('language', (isset($filters['language']) ? $filters['language'] : null)));

should be changed to
$data->set('language', $app->input->getString('language', (isset($filters['language']) ? $filters['language'] : null)));

Similar error corrected in: #7039
Please take off RTC status.

avatar zero-24 zero-24 - change - 29 May 2015
Status Ready to Commit Pending
avatar zero-24 zero-24 - change - 29 May 2015
Labels Removed: ?
avatar zero-24
zero-24 - comment - 29 May 2015

@pe7er I hope you can have a look into this after JAB or maybe tomorrow on the Hake it happen Session :smile:

avatar wilsonge
wilsonge - comment - 29 May 2015

Merged including the change suggested by @infograf768

avatar wilsonge wilsonge - change - 29 May 2015
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2015-05-29 17:29:42
Closed_By wilsonge
avatar wilsonge wilsonge - close - 29 May 2015
avatar wilsonge wilsonge - close - 29 May 2015
avatar zero-24 zero-24 - change - 29 May 2015
Milestone Added:
avatar johanjanssens johanjanssens - reference | 6f91c19 - 19 Jun 15
avatar pe7er pe7er - head_ref_deleted - 5 Nov 2015

Add a Comment

Login with GitHub to post a comment