Skip to content

[com_associations] Correcting wrong Reference association in Target assoc field#25704

Merged
HLeithner merged 5 commits intojoomla:stagingfrom
infograf768:reference_target_item_display
Jul 31, 2019
Merged

[com_associations] Correcting wrong Reference association in Target assoc field#25704
HLeithner merged 5 commits intojoomla:stagingfrom
infograf768:reference_target_item_display

Conversation

@infograf768
Copy link
Copy Markdown
Member

Summary of Changes

Added data-title-value to force display the correct association for the Reference item in the Target assoc field.

Thanks @robbiejackson for the code.

Testing Instructions

Create a multilingual site from clean install, using the default multilingual proposed when installing joomla. 2 languages are enough.
Go to com_associations and select articles and en-GB.
I installed French.
Click the grey icon for FR when reference is Article (en-GB)

Before patch

The reference item is wrong
Screen-Shot-2019-07-25-at-15 51 42_red_stroke3x

After patch

Issue corrected
Screen-Shot-2019-07-25-at-15 56 523xafter

Note: this is a very old bug that kept unseen.

@richard67
Copy link
Copy Markdown
Member

richard67 commented Jul 25, 2019

@infograf768 It seems the minimized js is wrong: When I have Joomla debug on so unminified file is loaded, then all is ok, but when I switch debug off so the minified file is loaded, I get following JS error in the browser console:

SyntaxError: missing } after function body sidebyside.js:1:13043
note: { opened at line 1, column 207 sidebyside.js:1:207

This seems to work, the minified version in your PR contains still the comments and so breaks syntax.
@richard67
Copy link
Copy Markdown
Member

@infograf768 Made PR against your repo for minified (or compressed or uglified or however it is called) js.

@richard67
Copy link
Copy Markdown
Member

richard67 commented Jul 25, 2019

I have tested this item 🔴 unsuccessfully on a98c1f0

Uncompressed js works, but compressed js has comments not stripped off and so has syntax errors.

See comment here: #25704 (comment)

Fix is here: infograf768#51


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

@infograf768
Copy link
Copy Markdown
Member Author

infograf768 commented Jul 26, 2019

@richard67
Thanks. I just did not paste the correct minified in my local .diff, but the uncompressed file itself, so it was only partly minified... I'm getting old.
can be tested again.

@richard67
Copy link
Copy Markdown
Member

@infograf768 No, it was the heat, I am sure 😅

@richard67
Copy link
Copy Markdown
Member

I have tested this item ✅ successfully on 22dda4f


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

@ghost
Copy link
Copy Markdown

ghost commented Jul 26, 2019

What i'm missing? I get:
Screen Shot 2019-07-26 at 10 38 29

@richard67
Copy link
Copy Markdown
Member

@franz-wohlkoenig Either cached version of minified js loaded, or patch not applied, or only partly applied.

  1. After applying patch, force reload of the page (e.g. in Firefox: Shift-Key plus reload button left beside URL).
  2. If 1. does not work: What do you get if you enable system debug in global config so the unminified js is used?

@ghost
Copy link
Copy Markdown

ghost commented Jul 26, 2019

The Screenshot is before Patch.

@richard67
Copy link
Copy Markdown
Member

richard67 commented Jul 26, 2019

@franz-wohlkoenig Then it is correct. You see the empty English association at the right hand side? Will be correctly filled after patch is applied and changed js is loaded.

@ghost
Copy link
Copy Markdown

ghost commented Jul 26, 2019

I have tested this item ✅ successfully on 22dda4f


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

@ghost
Copy link
Copy Markdown

ghost commented Jul 26, 2019

Status "Ready To Commit".

@joomla-cms-bot joomla-cms-bot added the RTC This Pull Request is Ready To Commit label Jul 26, 2019
@infograf768
Copy link
Copy Markdown
Member Author

Note: I see other weird stuff:

  1. @franz-wohlkoenig screen shot does not display the fields in the same order than mine. I found out that this depends on the order of the Content Languages in the Manager and not on the alpha order of the lang tags which is used in the usual Language field.
    Not a big deal: we can live with that. :)

  2. When installing a language, the Content Language created only contains part of the lang tag i.e. the country code, contrary to the default en-GB.
    If I install de-AT it will be German(AT).
    That should be corrected because we may have 2 different languages with the same country code and it would be hard to differentiate.
    Looking into that now

@richard67
Copy link
Copy Markdown
Member

@infograf768 2. Is not an issue for me. Spanish(ES) and Catalan(ES) would be easy to distinguish for me.

Harder is maybe German(AT) and German(DE) and so on, but that's the other way round.

On my site I have both country and language as complete word in my content language name, and text is in the particular language, like "Deutsch (Deutschland)", "English (United Kingdom)" or "Русский (Россия)", so people find it in their language in the link title of the language switcher, that's how I like it.

@infograf768
Copy link
Copy Markdown
Member Author

Concerning 2. It looks related to the install.xml from which the LanguageAdapter picks the Title

// Set the content language title as the language metadata name.
			$contentLanguageTitle = $siteLanguageManifest['name'];

This means we have to instruct TTs to pay attention to that. or modify code

@richard67
Copy link
Copy Markdown
Member

@infograf768 Yes and that's why it is weird, because different TT use different way, so the result is not consistent.

@richard67
Copy link
Copy Markdown
Member

We should force TTs to use the "Deutsch (Deutschland)", "English (United Kingdom)" or "Русский (Россия)" way for the content language names (or titles) and another standardized way for the site or admin language names shown in the backend.

@infograf768
Copy link
Copy Markdown
Member Author

@richard67
Yep. Will share this in TT Coordination.

@richard67
Copy link
Copy Markdown
Member

Admin and site languages should always be like "de-DE", "en-GB" and so on so you can switch backend language and still understand it. For content language see above.

@infograf768
Copy link
Copy Markdown
Member Author

@richard67

We should force TTs to use the "Deutsch (Deutschland)", "English (United Kingdom)" or "Русский (Россия)"

Will share this in TT Coordination. I think though that the real tag is enough because of the size of the fields. Admin will have to modify as they like and as you did.
So, we would have for metadata French (fr-FR) for example.

@richard67
Copy link
Copy Markdown
Member

I can live with that as long as it is consistent at the end ;-)

@infograf768
Copy link
Copy Markdown
Member Author

infograf768 commented Jul 26, 2019

It would be consistent with what we have for en-GB.
Just did it for French:
Screen Shot 2019-07-26 at 11 47 54

@infograf768
Copy link
Copy Markdown
Member Author

@HLeithner
Please merge.

@HLeithner HLeithner merged commit 4f3ae92 into joomla:staging Jul 31, 2019
@HLeithner
Copy link
Copy Markdown
Member

thx

@HLeithner HLeithner added this to the Joomla! 3.9.11 milestone Jul 31, 2019
@joomla-cms-bot joomla-cms-bot removed the RTC This Pull Request is Ready To Commit label Jul 31, 2019
@infograf768 infograf768 deleted the reference_target_item_display branch November 4, 2019 19:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants