User tests: Successful: Unsuccessful:
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.
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").
Create a New Article
Look on the right:
on basis of Access Level & Language filters.
After the PR the parameters on the right should show:
Labels |
Added:
?
|
Category | ⇒ | Administration UI/UX |
Status | New | ⇒ | Pending |
Easy | No | ⇒ | Yes |
Milestone |
Added: |
All is working fine. Great addition. Thanks Peter.
Status | Pending | ⇒ | Ready to Commit |
Milestone |
Removed: |
Labels |
Added:
?
|
Also tested successfully after code changes in variable name.
Milestone |
Added: |
Should not we pre-select language only when JLanguageMultilang::isEnabled() ?
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!
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?
This makes sense.
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)); }
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.
I've added the Status field to the pre-selectable fields. Please re-test!
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").
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
Milestone |
Removed: |
Status | Ready to Commit | ⇒ | Pending |
Labels |
Removed:
?
|
Not sure about the status field, Peter. One rarely creates a new item with a different status than published. Implementing this may confuse users.
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.
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/
Two goo tests of the final version of the code - setting RTC - thanks all
Labels |
Added:
?
|
Status | Pending | ⇒ | Ready to Commit |
$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.
Status | Ready to Commit | ⇒ | Pending |
Labels |
Removed:
?
|
Merged including the change suggested by @infograf768
Status | Pending | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2015-05-29 17:29:42 |
Closed_By | ⇒ | wilsonge |
Milestone |
Added: |
@test Success. Hathor, too.
@pe7er Nice feature. I like it.