Skip to content

[NEW FEATURE] Adding Edit Associations Toolbar#21022

Merged
mbabker merged 13 commits intojoomla:3.9-devfrom
infograf768:edit_assoc_toolbar
Jul 16, 2018
Merged

[NEW FEATURE] Adding Edit Associations Toolbar#21022
mbabker merged 13 commits intojoomla:3.9-devfrom
infograf768:edit_assoc_toolbar

Conversation

@infograf768
Copy link
Copy Markdown
Member

@infograf768 infograf768 commented Jul 9, 2018

Pull Request for Issue #21003

Summary of Changes

Adding a new toolbar for items which can be associated.
The toolbar button redirects to the side by side Multilingual associations component.
Changes include new methods in FormController as in AdminModel.
And the new toolbar button for each view concerned.

Testing Instructions

Install a multilngual site. Make sure Associations are set.
Edit any

  • article
  • contact
  • menu item
  • newsfeed
  • category

Click on the new Edit Associations Toolbar button. Example:
screen shot 2018-07-09 at 11 57 31

You should be redirected to the side by side.
screen shot 2018-07-09 at 12 08 12

If the item is set to ALL languages, a Notice will display.
screen shot 2018-07-09 at 12 09 16

Documentation Changes Required

I guess so. Target is 3.9.x

@Bakual @rdeutz @alikon

@infograf768
Copy link
Copy Markdown
Member Author

Looks like this needs some cs corrections to make drone happy...
Trying now.

@infograf768 infograf768 added this to the Joomla 3.9.0 milestone Jul 9, 2018
}
else
{
if ($data['language'] === '*')
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Minor suggestion. Lines 1579-1596 don’t need to be in the else statement.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Indeed, will correct.

JGLOBAL_ARTICLE_ORDER_LABEL="Article Order"
JGLOBAL_ARTICLES="Articles"
JGLOBAL_ASSOC_NOT_POSSIBLE="To define associations, please make sure the item language is not set to 'All'."
JGLOBAL_ASSOCIATIONS_NEW_ITEM_WARNING="To edit associations, first save the item."
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

==> To create an association, first save the item.

But can this actually be displayed as the button isnt presnt until you have saved the item

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This is just a security warning in case something goes wrong. Will change string as indeed when not saved one can't edit any assoc.

JTOOLBAR_DISABLE="Disable"
JTOOLBAR_DUPLICATE="Duplicate"
JTOOLBAR_EDIT="Edit"
JTOOLBAR_EDIT_ASSOCIATIONS="Edit Associations"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It is both edit and create so let's just say "Associations"

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I have been wondering about that. The issue is that we already have an Associations Tab.

@brianteeman
Copy link
Copy Markdown
Contributor

Other than my language string comments - this works well

@brianteeman
Copy link
Copy Markdown
Contributor

The check to ensure that the language is not "all" doesnt check that it has actually been saved with a set language.

assoc

@infograf768
Copy link
Copy Markdown
Member Author

hmm
this needs some thought. After siesta.

@brianteeman
Copy link
Copy Markdown
Contributor

I have tested this item 🔴 unsuccessfully on f4e6698


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

@infograf768
Copy link
Copy Markdown
Member Author

The issue is interesting as we have the same behavior when using the associations Tab (through js).
In that last case though, after choosing one or multiple associations we DO save the item, preventing this problem.
Let's see what we can do here.

@infograf768
Copy link
Copy Markdown
Member Author

@brianteeman
Please test again. It works fine now here.

@infograf768
Copy link
Copy Markdown
Member Author

infograf768 commented Jul 9, 2018

Note: the multilingual manager may not show the item once target is saved and Close button has been used. But the item IS saved with the selected language and correctly associated to the target. Just select the right type of item and language.
One way to see that is to look at the Associations column in the mulilingual manager or the item manager itself (whatever item concerned).

@micker
Copy link
Copy Markdown

micker commented Jul 9, 2018

same return, in fact that a great addition ! we win a lot of time thanks !

@infograf768
Copy link
Copy Markdown
Member Author

infograf768 commented Jul 9, 2018

@micker
please mark your test ok on https://issues.joomla.org/tracker/joomla-cms/21022

@infograf768
Copy link
Copy Markdown
Member Author

@brianteeman
The issue you described in #21022 (comment) is now solved.
Please test again.
edit_assoc

@micker
Copy link
Copy Markdown

micker commented Jul 10, 2018

Tested its ok for me


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

@ghost
Copy link
Copy Markdown

ghost commented Jul 10, 2018

at Issue Tracker Test of @micker is shown as successfully. I altered it too but it isn't shown here.

@infograf768
Copy link
Copy Markdown
Member Author

at Issue Tracker Test of @micker is shown as successfully. I altered it too but it isn't shown here.

Yes, I had marked it as successful as he did not do it really, but we have an issue.
We also have an issue with Travis which was working Ok before.

@brianteeman
Copy link
Copy Markdown
Contributor

The issue I reported has been resolved.

BUT I found another one when "editing" associations.

When I open an item that is already associated and then select "edit associations" I expected to be redirected to com_associations with the item AND its association open but it is not.

Thinking about solving this I can see that on a bilingual site what I described would be the expected behaviour but it wouldnt be possible on a site with more than two languages.

So it can only be resolved, imho, by changing the expectation of clicking on the button "edit associations". Perhaps just saying "associations" on the button will do that.

@brianteeman
Copy link
Copy Markdown
Contributor

This can't be expected as the Target Language is not set yet.

I was referring to editing an item that already had an association created.

JTOOLBAR_DISABLE="Disable"
JTOOLBAR_DUPLICATE="Duplicate"
JTOOLBAR_EDIT="Edit"
JTOOLBAR_ASSOCIATIONS="Associations"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Please sort key in alpha order.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

doing it now. Thanks

if ($this->text_prefix === 'COM_CATEGORIES')
{
$extension = $app->input->get('extension', 'com_content');
$this->typeAlias = $extension . '.category';
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Remove extra space before =

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

doing too

@micker
Copy link
Copy Markdown

micker commented Jul 10, 2018

sorry i don't find how to set tested ok ... only in texte ... newbie lol

@infograf768
Copy link
Copy Markdown
Member Author

@brianteeman
I have improved this code IF we have only 2 Content Languages.
What will happen is the following:

  1. It will load directly an eventual associated item in the side by side.
  2. If no association it will already select the target language in the side by side.

It is obviously impossible to do the same if we have more than 2 content languages

@micker
This has to be tested again with this specific case.

@brianteeman
Copy link
Copy Markdown
Contributor

@infograf768 awesome. If not already merged I will test tomorrow

$lang_code[] = $language->lang_code;
}

$refLang = array($data['language']);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Remove spaces before =

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

done. thanks.

@jreys
Copy link
Copy Markdown
Contributor

jreys commented Jul 11, 2018

I have tested this item ✅ successfully on 0db5e28

Works as expected now :)


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

@infograf768
Copy link
Copy Markdown
Member Author

@jreys Thanks for testing.

Needs one more test. @micker @brianteeman

@micker
Copy link
Copy Markdown

micker commented Jul 12, 2018

tested ✅ successfully on 0db5e28


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

@joomla-cms-bot joomla-cms-bot removed this from the Joomla 3.9.0 milestone Jul 12, 2018
@ghost
Copy link
Copy Markdown

ghost commented Jul 12, 2018

Ready to Commit after two successful tests.

@joomla-cms-bot joomla-cms-bot added the RTC This Pull Request is Ready To Commit label Jul 12, 2018
@ghost
Copy link
Copy Markdown

ghost commented Jul 12, 2018

why was successfully Test of @micker not shown at Issue Tracker (have altered Test now)?

@micker
Copy link
Copy Markdown

micker commented Jul 12, 2018

@franz-wohlkoenig sorry i am a newbie on tracker how i can do this

@ghost
Copy link
Copy Markdown

ghost commented Jul 12, 2018

@micker this was not to you, it was a Question on People knowing more than me how this could be (as similar happen a few Days ago).

On your Question as Example of this PR:

Please mark your Test as successfully:

  • open Issue Tracker
  • Login with your github-Account
  • Click on blue "Test this"-Button above Authors-Picture
  • mark your Test as successfully
  • hit "submit test result"

@ghost
Copy link
Copy Markdown

ghost commented Jul 12, 2018

@micker before i forget: Thanks for your Work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants