-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
[4.0] Plg parentassociations #17881
Conversation
Thank you for your contribution. Please can you review it and resolve the following
|
In addition to Brian's findings:
|
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. |
Thanks brianteeman. This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/17881. |
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])){ |
There was a problem hiding this comment.
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) ) |
There was a problem hiding this comment.
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])){ |
There was a problem hiding this comment.
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> |
There was a problem hiding this comment.
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> |
There was a problem hiding this comment.
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> |
There was a problem hiding this comment.
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> |
There was a problem hiding this comment.
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> |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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')) |
There was a problem hiding this comment.
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.
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. But, if I switch to French, I get 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: As you can see there, my feeling the only way to deal with this is dates/comparison. |
infograf768. Thank u for your feedback. This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/17881. |
The sql CREATE TABLE has still not been updated.
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). 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: 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. |
@infograf768 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. |
Sorry to disagree. If you are not implementing a specific language as master, this will be totally confusing. |
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 |
Going to close this one as after a year without update it has clearly been abandoned. It can always be reopened if updated. |
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
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
Create first article (DE)
Create second article (ID)
Create a third article (EN)
First article with second associate
Compare languages and press "Save Approved" as shown in Figure 1
First article with third article associate
In the Component Multilingual Associtation, select the first article as shown in Figure 2
Select third article, red exclamation point should appear according to main language (Figure 3)
If item is green, then in the info text Approved = 1 (see first picture).
If articles are yellow, then in the info text Approved = 0.
If articles are gray, then in the info text without Approved
Expected result
Figure 1:
![test3](https://user-images.githubusercontent.com/26348675/30077458-2f8c338c-927c-11e7-81d7-076f6ab29e2d.png)
![test](https://user-images.githubusercontent.com/26348675/30077496-50217170-927c-11e7-8404-126bc72349a0.png)
![test2](https://user-images.githubusercontent.com/26348675/30077504-576cd6b8-927c-11e7-8a1f-c4e414db7b55.png)
Figure 2:
Figure 3: