Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[mod_articles_latest] Option for choose an specific author(s) #20687

Merged
merged 5 commits into from Jun 18, 2018

Conversation

@carlitorweb
Copy link
Contributor

@carlitorweb carlitorweb commented Jun 7, 2018

Pull Request for Issue #20685

Summary of Changes

New option for filter articles by a specific authors

Testing Instructions

  • Enter to the mod_articles_latest and choose the value Created by in the option Authors. Select an author(s) and save.
  • Go to the front end, and check the list of articles is only from the author(s) you selected

Expected result

Only articles from selected users are displayed

Actual result

The module no have the option to choose specific author(s)

Documentation Changes Required

Yes, need document the new option

Additional comments

You can use the module Articles - Category for have this, but as Articles - Latest have an option for filter by authors, is incomplete if you cant choose a specific author(s).

Copy link
Member

@brianteeman brianteeman left a comment

approve language strings

@ghost
Copy link

@ghost ghost commented Jun 8, 2018

@uzielweb can you please test as you wrote #20685?

@@ -73,6 +73,10 @@ public static function getList(&$params)
$model->setState('filter.author_id.include', false);
break;

case 'created_by' :
$model->setState('filter.author_id', $params->get('author'));

This comment has been minimized.

@SharkyKZ

SharkyKZ Jun 8, 2018
Contributor

Add default value array().

This comment has been minimized.

@carlitorweb

carlitorweb Jun 8, 2018
Author Contributor

Thank you


<field
name="author"
type="sql"

This comment has been minimized.

@SharkyKZ

SharkyKZ Jun 8, 2018
Contributor

Use author field type.

This comment has been minimized.

@carlitorweb

carlitorweb Jun 8, 2018
Author Contributor

@SharkyKZ Why? author field only lets you select, 1 user only

This comment has been minimized.

@SharkyKZ

SharkyKZ Jun 8, 2018
Contributor

author field supports multiple attribute. Not to be mistaken with user field.

This comment has been minimized.

@carlitorweb

carlitorweb Jun 8, 2018
Author Contributor

My bad again. author field was my first option when I was doing this PR, but, I did not saw this part of support multiple attribute inside the code. Now checking again, after you told me this, I saw it inside the JFormFieldList class. I need to buy some glasses with enough magnification 😞 . Thank you again for your time @SharkyKZ

value_field="name"
showon="user_id:created_by"
>
<option value="0">JOPTION_SELECT_AUTHORS</option>

This comment has been minimized.

@SharkyKZ

SharkyKZ Jun 8, 2018
Contributor

Selecting 0 returns articles without author. So language constant should be JNONE or similar.

This comment has been minimized.

@carlitorweb

carlitorweb Jun 8, 2018
Author Contributor

Is true. Thank you

@@ -4,6 +4,8 @@
; Note : All ini files need to be saved as UTF-8

MOD_ARTICLES_LATEST="Articles - Latest"
MOD_LATEST_NEWS_FIELD_AUTHOR_DESC="Select one or more authors from the list below."

This comment has been minimized.

@Quy

Quy Jun 8, 2018
Contributor

Change to Select one or more authors.. The list is not below but next to the label.

This comment has been minimized.

@carlitorweb

carlitorweb Jun 8, 2018
Author Contributor

Done, thank you. Also i change the label, for -> Created by author(s)

carlitorweb added 2 commits Jun 8, 2018
@@ -4,6 +4,8 @@
; Note : All ini files need to be saved as UTF-8

MOD_ARTICLES_LATEST="Articles - Latest"
MOD_LATEST_NEWS_FIELD_AUTHOR_DESC="Select one or more authors."
MOD_LATEST_NEWS_FIELD_AUTHOR_LABEL="Created by author(s)"

This comment has been minimized.

@Quy

Quy Jun 8, 2018
Contributor

Please capitalize Created by Authors since it is a label.

This comment has been minimized.

@carlitorweb

carlitorweb Jun 8, 2018
Author Contributor

Sorry, done

showon="user_id:created_by"
>
<option value="0">JNONE</option>

This comment has been minimized.

@SharkyKZ

SharkyKZ Jun 8, 2018
Contributor

Restore <option value="0">JNONE</option> please. It's a valid option.

This comment has been minimized.

@brianteeman

brianteeman Jun 8, 2018
Member

Not really - you wouldnt have chosen to filter by author if yoou wanted to set it to none

This comment has been minimized.

@SharkyKZ

SharkyKZ Jun 8, 2018
Contributor

None returns articles which have no author assigned. Maybe the string could read No Author but None is what we have now (see Search Tools in com_content).

This comment has been minimized.

@carlitorweb

carlitorweb Jun 8, 2018
Author Contributor

I removed because the same think as brian. If I there is for select an author. However, return a no author is valid too, but then you will need search for alias? because I do not see the point of show the last articles, for a no author list.

@ghost
Copy link

@ghost ghost commented Jun 16, 2018

I have tested this item successfully on 0c75fd0


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

1 similar comment
@Quy
Copy link
Contributor

@Quy Quy commented Jun 16, 2018

I have tested this item successfully on 0c75fd0


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

@Quy
Copy link
Contributor

@Quy Quy commented Jun 16, 2018

RTC


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

@joomla-cms-bot joomla-cms-bot added the RTC label Jun 16, 2018
@mbabker mbabker changed the base branch from staging to 3.9-dev Jun 18, 2018
@mbabker mbabker added this to the Joomla 3.9.0 milestone Jun 18, 2018
@mbabker mbabker merged commit 4b92d27 into joomla:3.9-dev Jun 18, 2018
4 of 5 checks passed
4 of 5 checks passed
continuous-integration/appveyor/pr AppVeyor build failed
Details
Hound No violations found. Woof!
JTracker/HumanTestResults Human Test Results: 2 Successful 0 Failed.
Details
continuous-integration/drone/pr the build was successful
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@joomla-cms-bot joomla-cms-bot added PR-3.9-dev and removed RTC labels Jun 18, 2018
@carlitorweb carlitorweb deleted the carlitorweb:modLastedArticle_createdByOption branch Jun 20, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

6 participants
You can’t perform that action at this time.