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

[4.0] Plg parentassociations #17881

Closed

Conversation

AresRoxx10
Copy link

@AresRoxx10 AresRoxx10 commented Sep 5, 2017

Pull Request for Issue # .

Summary of Changes

Implement a color presentation in which one can see if the same articles are in the same state in different languages. The user has to manually check as articles that are not actually marked, adjust if necessary, and finally confirm as current.
If there are several articles in different languages with the same content, they can already be linked to each other in order to identify their belonging together. In order to simplify the above-mentioned functionality, a master-slave relationship has also been implemented between the articles. Specifically, this means that within an article group an article exists which is defined as the main article (master). All related articles should derive from the main article and from their slaves. In the application, all slaves are marked as unactual as soon as the master changes.

Testing Instructions

  1. Install at least 4 (e.g., De, ID, EN, FR, AF) languages
    When you install a language, you must add the following values ​​in the language as in C:\xampp1\htdocs\WPW3\administrator\language\en-GB\en-GB.com_associations.ini
    add the following values ​​in the appropriate language.
    COM_ASSOCIATIONS_SAVE_APPROVED="Save Approved"
    COM_ASSOCIATIONS_NOT_APPROVED_NOPARENT="reference is not the master"
    COM_ASSOCIATIONS_MESSAGE_APPROVED="approved"
    COM_ASSOCIATIONS_NOTCHILD="firstly save the Target Article

  2. Create first article (DE)

  3. Create second article (ID)

  4. Create a third article (EN)

  5. First article with second associate

  6. Compare languages and press "Save Approved" as shown in Figure 1

  7. First article with third article associate

  8. In the Component Multilingual Associtation, select the first article as shown in Figure 2

  9. Select third article, red exclamation point should appear according to main language (Figure 3)

  10. If item is green, then in the info text Approved = 1 (see first picture).

  11. If articles are yellow, then in the info text Approved = 0.

  12. If articles are gray, then in the info text without Approved

Expected result

Figure 1:
test3
Figure 2:
test
Figure 3:
test2

@brianteeman
Copy link
Contributor

Thank you for your contribution. Please can you review it and resolve the following

  1. Comments should be in english only (not french and german)
  2. Code should not be commented out
  3. Please resolve the conflicting files
  4. Please look at the codestyle - specifically the indentations/tabs See https://developer.joomla.org/coding-standards.html

@richard67
Copy link
Member

In addition to Brian's findings:

@christianboulbi
Copy link

Thank u for your feedback.

I have made some changes. can u please check it again ?


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

@brianteeman
Copy link
Contributor

brianteeman commented Sep 6, 2017

Indentation issues

screenshotr09-26-29

German comments

screenshotr09-26-50

Conflicts

screenshotr09-27-24

@christianboulbi
Copy link

Thanks brianteeman.
Is it ok now?


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

@brianteeman
Copy link
Contributor

My screenshots were just examples. I still see lots of the issues I first mentioned - github will show you all the issues - please review them all

continue;
}
$approved = null;
if(isset($items[$langCode])){
Copy link
Member

Choose a reason for hiding this comment

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

if(isset($items[$langCode])){ change to:

if (isset($items[$langCode]))
{



// CASE: Associated and approved
if (($associationMode == 1) )
Copy link
Member

Choose a reason for hiding this comment

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

remove space between ) )

// CASE: Associated and approved
if (($associationMode == 1) )
{
if(!isset($items[$langCode])){
Copy link
Member

@C-Lodder C-Lodder Sep 6, 2017

Choose a reason for hiding this comment

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

spacing and put curly brace on new line

<copyright>Copyright</copyright>
<license>GNU/GPL</license>
<version>1.0</version>
<description>Administrate die Relation between articles</description>
Copy link
Member

Choose a reason for hiding this comment

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

Change description to en-GB

<name>articleassociations</name>
<creationDate>24.08.2017</creationDate>
<author>Joomla! Project</author>
<authorEmail>christian.djombissi.wameni@mni.thm.de</authorEmail>
Copy link
Member

Choose a reason for hiding this comment

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

Change email to admin@joomla.org

<creationDate>24.08.2017</creationDate>
<author>Joomla! Project</author>
<authorEmail>christian.djombissi.wameni@mni.thm.de</authorEmail>
<authorUrl>http://localhost/joomla-cms-staging/joomla-cms-staging/</authorUrl>
Copy link
Member

Choose a reason for hiding this comment

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

Change URL to www.joomla.org

<authorEmail>christian.djombissi.wameni@mni.thm.de</authorEmail>
<authorUrl>http://localhost/joomla-cms-staging/joomla-cms-staging/</authorUrl>
<copyright>Copyright</copyright>
<license>GNU/GPL</license>
Copy link
Member

Choose a reason for hiding this comment

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

Change license to GNU General Public License version 2 or later; see LICENSE.txt

<author>Joomla! Project</author>
<authorEmail>christian.djombissi.wameni@mni.thm.de</authorEmail>
<authorUrl>http://localhost/joomla-cms-staging/joomla-cms-staging/</authorUrl>
<copyright>Copyright</copyright>
Copy link
Member

Choose a reason for hiding this comment

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

Change copyright to (C) 2005 - 2017 Open Source Matters. All rights reserved.

`parentid` int(10) NOT NULL DEFAULT 0,
`approved` tinyint(1) NOT NULL DEFAULT 0,
PRIMARY KEY (`id`)
)ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci;
Copy link
Member

Choose a reason for hiding this comment

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

Error
Missing COMMENT

CREATE TABLE IF NOT EXISTS `#__item_associations` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Primary Key',
  `parentid` int(10) NOT NULL DEFAULT 0,
  `approved` tinyint(1) NOT NULL DEFAULT 0,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci;
  

$selectQuery = $db->getQuery(true);
$selectQuery
->select('id,parentid')
->from($db->quoteName('item_associations'))
Copy link
Member

Choose a reason for hiding this comment

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

Error
Should be
>from($db->quoteName('#__item_associations'))
And also below a few times.

@infograf768
Copy link
Member

Apart from the obvious errors I found (see above) and a lot of coding standards corrections to do (+ postgresql impossible to merge), + a few glitches (Target article Checked out after Save Approved) I am not sure this approach is the one we need.

Basically, and whatever the way the UI is displayed, I think we must always have a fixed reference language (Parent should be in the refernce language) and the possibility to filter stuff by outdated, not associated or up-to-date.

The problem is when you change languages.
Below, Article English has been modified in the Articles usual UI.
Therefore the FR icon displays as orange with NOT approved.

screen shot 2017-09-07 at 08 46 06

But, if I switch to French, I get
screen shot 2017-09-07 at 08 49 31

This is really misleading and therefore the reason why I insist on choosing always the same reference language.

I guess the new plugin is used to mark as Not approved the associated article when the "Parent" is modified. Unhappily, it is specific to articles, i.e. any other possible association (categories, menu items, contacts, etc. are not concerned.

Please read this:
#17802 (comment) to further understand my comment.

As you can see there, my feeling the only way to deal with this is dates/comparison.
The use of a new table as you do here could be the way to go.

@perrez
Copy link

perrez commented Sep 7, 2017

infograf768. Thank u for your feedback.
if you change a master article, all slave-article of this article still need to be approved.


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

@infograf768
Copy link
Member

infograf768 commented Sep 7, 2017

The sql CREATE TABLE has still not been updated.

@perrez

if you change a master article, all slave-articles of this article still need to be approved.

That is not my point. Obviously, whether you call it approved or up-to-date the new status should be easy to find and act accordingly, the issue is that one has to have only ONE master article (or other type of item).
IN the existng UI, switching languages will change the Master. We do not want that. We need to set a specific language as MASTER for the site in order to be able to get a usable feature (with filters, etc.). Please re-read my proposal in the other PR and both screenshots above where the problem displays perfectly.

We should not have to click on "Save Approved", but just saving the Target would make it automatically Up-to-date.

This means that if we have a new table to store correctly the modified date, and add this for every component when Assoc is on, Multilingual associations will know by date comparison if the target is Up-to-date or not.

Example:
I have an article tagged to English and the Default site Reference language is English (as proposed in the other PR).
The language filter plugin is set to use associations.
When saving this article, it will not only save it in the content table but also save its id, type and modified date in the new table (can be item_associations if you wish).
As the current Multingual Associations main page is not set for this — one can choose a reference in ANY language — we would have a new page ( the STATUS page) specially aimed at comparing THE MASTER to its SLAVES, letting filter the slaves per language used in the site or all languages (obvioulsy without the refernce language) and status.
It will then be real easy to know what is or not Up-to-date, etc.

On the Face to Face page (same one or a new one), once decided or not to change the Slave (or also maybe the Reference too), Saving Target would also Save the Reference and enter in the new Table the same Modified date, therefore updating the STATUS page where we compare MASTER to SLAVES when we go back there.

@perrez
Copy link

perrez commented Sep 7, 2017

@infograf768
Thanks for the proposal of adding another Attribute to our table that will save the initial Article which has been changed and serves as Master. That is a good idea .
But our aim is to give the user the possibility to be able to manually check (approve) the Slave Article. The Master article is the article without a parent article and it can derive the children article

As a extension, we will want that the Slave Article which has already been checked should also become a master article.


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

@infograf768
Copy link
Member

Sorry to disagree. If you are not implementing a specific language as master, this will be totally confusing.

@jreys
Copy link
Contributor

jreys commented Sep 7, 2017

Yup, agree with @infograf768, without setting a master language and comparing modified dates, this can cause some troubles, his solution looks the most elegant for this problem

@joomla-cms-bot joomla-cms-bot changed the title Plg parentassociations [4.0] Plg parentassociations Oct 29, 2017
@brianteeman
Copy link
Contributor

Going to close this one as after a year without update it has clearly been abandoned. It can always be reopened if updated.

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.

None yet

9 participants