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
Merged

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

merged 5 commits into from
Jun 18, 2018

Conversation

carlitorweb
Copy link
Member

@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
Contributor

@brianteeman brianteeman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

approve language strings

@ghost
Copy link

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'));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add default value array().

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you


<field
name="author"
type="sql"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use author field type.

Copy link
Member Author

@carlitorweb carlitorweb Jun 8, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>
Copy link
Contributor

@SharkyKZ SharkyKZ Jun 8, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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."
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@@ -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)"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please capitalize Created by Authors since it is a label.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, done

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 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 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 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 This Pull Request is Ready To Commit label Jun 16, 2018
@mbabker mbabker changed the base branch from staging to 3.9-dev June 18, 2018 02:50
@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
@joomla-cms-bot joomla-cms-bot added PR-3.9-dev and removed RTC This Pull Request is Ready To Commit labels Jun 18, 2018
@carlitorweb carlitorweb deleted the modLastedArticle_createdByOption branch June 20, 2018 12:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Language Change This is for Translators
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants