? ? Success

User tests: Successful: Unsuccessful:

avatar mannybiker
mannybiker
17 Apr 2016

Pull Request for Issue # .

Summary of Changes

The TOS field in the user profile plugin permits to link an article containing the TOS text. This feature does not include MultiLanguage support. With this PR now the plugin will select the right article for the current used language between the available associated articles if the Language Associations option
is enabled.

Testing Instructions

Create a multisite web config
Enable the user profile plugin and its Language Associations option
Select an article for the TOS in the user profile plugin
Configure associated articles for the article selected before

avatar mannybiker mannybiker - open - 17 Apr 2016
avatar mannybiker mannybiker - change - 17 Apr 2016
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 17 Apr 2016
Labels Added: ?
avatar brianteeman brianteeman - change - 18 Apr 2016
Category Multilanguage Plugins
avatar mikeveeckmans mikeveeckmans - test_item - 18 Apr 2016 - Tested successfully
avatar mikeveeckmans
mikeveeckmans - comment - 18 Apr 2016

I have tested this item :white_check_mark: successfully on 6751718

TEST OK

Entered a DUTCH TOS in the plugin as article, made association to UK version. When registering in the frontend on UK language I get the UK TOS.
(before patch i got a 404)


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

avatar infograf768
infograf768 - comment - 18 Apr 2016

Please make Travis happy:

FOUND 4 ERROR(S) AND 1 WARNING(S) AFFECTING 3 LINE(S)

--------------------------------------------------------------------------------

  97 | WARNING | Inline control structures are discouraged

  98 | ERROR   | No space found after comma in function call

  98 | ERROR   | No space found after comma in function call

  98 | ERROR   | No space found after comma in function call

 101 | ERROR   | Expected "if (...)\n...{...}\n...else\n"; found "if (...)

     |         | ...{...}\n...else\n"
avatar infograf768
infograf768 - comment - 18 Apr 2016

I.e. you should modify the PR to get:

            $db    = JFactory::getDbo();
            $query = $db->getQuery(true);
            $query->select('id, alias, catid, language')
                ->from('#__content')
                ->where('id = ' . $tosarticle);
            $db->setQuery($query);
            $article = $db->loadObject();

            if (JLanguageAssociations::isEnabled())
            {
                $tosassociated = JLanguageAssociations::getAssociations('com_content', '#__content', 'com_content.item', $tosarticle);
            }

            $current_lang = JFactory::getLanguage()->getTag();

            if ($current_lang != $article->language && array_key_exists($current_lang, $tosassociated))
            {
                $url = ContentHelperRoute::getArticleRoute($tosassociated[$current_lang]->id, $tosassociated[$current_lang]->catid);
            }
            else
            {
                $slug = $article->alias ? ($article->id . ':' . $article->alias) : $article->id;
                $url = ContentHelperRoute::getArticleRoute($slug, $article->catid);
            }
avatar wojsmol wojsmol - reference | 54e9fc6 - 18 Apr 16
avatar wojsmol
wojsmol - comment - 18 Apr 2016
avatar joomla-cms-bot
joomla-cms-bot - comment - 18 Apr 2016

This PR has received new commits.

CC: @mikeveeckmans


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

avatar mannybiker
mannybiker - comment - 18 Apr 2016

I am sorry for the errors. I am quite new to all these tools like github and php_codesniffer and the first time I really try to collaborate to a big project like Joomla. I have now configured php_codesniffer to avoid making again this kind of errors and raised a new commit with the code fix. Please forgive me and thanks for your help and suggestions.

avatar infograf768 infograf768 - test_item - 18 Apr 2016 - Tested successfully
avatar infograf768
infograf768 - comment - 18 Apr 2016

I have tested this item :white_check_mark: successfully on 0befa18

Great patch!


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

avatar MATsxm MATsxm - test_item - 18 Apr 2016 - Tested successfully
avatar MATsxm
MATsxm - comment - 18 Apr 2016

I have tested this item :white_check_mark: successfully on 0befa18

Thanks


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

avatar mannybiker
mannybiker - comment - 18 Apr 2016

This is a small patch but I am too happy and honoured to be appreciated by Guru like you!

avatar infograf768 infograf768 - change - 18 Apr 2016
Status Pending Ready to Commit
avatar infograf768
infograf768 - comment - 18 Apr 2016

RTC. Can go in 3.5.2.


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

avatar joomla-cms-bot joomla-cms-bot - change - 18 Apr 2016
Labels Added: ?
avatar rdeutz rdeutz - change - 18 Apr 2016
Milestone Added:
avatar rdeutz rdeutz - change - 18 Apr 2016
Labels Added: ?
avatar rdeutz
rdeutz - comment - 18 Apr 2016

I don't agree with the statement "can go into 3.5.x", I think this is a new feature and in fact it change how the system works. After the patch you get a different article when there was an associated article before.

avatar infograf768
infograf768 - comment - 18 Apr 2016

It does not break anything as it is totally BC, @rdeutz . It just adds the possibility to have a TOS per language with a very simple check in code. No use to wait for 3.6.0 to get this in.

avatar infograf768 infograf768 - change - 18 Apr 2016
Title
Added Multilanguage feature to the TOS linked article in user profile…
Added Multilanguage associations to the TOS linked article in user profile…
avatar joomla-cms-bot joomla-cms-bot - change - 18 Apr 2016
Title
Added Multilanguage feature to the TOS linked article in user profile…
Added Multilanguage associations to the TOS linked article in user profile…
avatar joomla-cms-bot joomla-cms-bot - change - 18 Apr 2016
Milestone Removed:
avatar rdeutz rdeutz - change - 18 Apr 2016
Milestone Added:
avatar rdeutz
rdeutz - comment - 18 Apr 2016

As I said, if you have an associated article for the chosen TOC before you will get this article after the patch and this is a change how the system behaves.

avatar rdeutz rdeutz - reference | a6b07a2 - 2 May 16
avatar rdeutz rdeutz - merge - 2 May 2016
avatar rdeutz rdeutz - close - 2 May 2016
avatar rdeutz rdeutz - close - 2 May 2016
avatar rdeutz rdeutz - merge - 2 May 2016
avatar joomla-cms-bot joomla-cms-bot - close - 2 May 2016
avatar rdeutz rdeutz - change - 2 May 2016
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2016-05-02 06:13:57
Closed_By rdeutz
avatar joomla-cms-bot joomla-cms-bot - change - 2 May 2016
Labels Removed: ?
avatar mannybiker mannybiker - head_ref_deleted - 7 May 2016
avatar jsubri
jsubri - comment - 8 May 2016

I've a Notice & Warning with this patch, I've enabled TOS as the only mandatory field, mono-lingual site.
Notice: Undefined variable: tosassociated in plugins ...\user\profile\fields\tos.php on line 104
Warning: array_key_exists() expects parameter 2 to be array, null given in plugins ...\user\profile\fields\tos.php on line 104

I've inserted "$tosassociated = array();" couple of lines above as a quick fix.

avatar mannybiker
mannybiker - comment - 9 May 2016

@jsubri Thanks for reporting.
I have issued a PR #10366

Add a Comment

Login with GitHub to post a comment