Skip to Content Skip to Menu

mod_uddeim language-spefic link does not work

  • Richard67
  • Richard67
  • OFFLINE
  • Posts: 30
  • Thanks: 1
  • Karma: 0
12 years 8 months ago - 12 years 8 months ago #193919 by Richard67
Hello,

I have a multilingual site with Joomla 2.5.2, CB 1.8 and uddeIM 2.6.

For each site language I have a separate main menu, and in each of these menus I have one link to the uddeIM component (inbox).

The link to the inbox shown in mod_uddeim uses readable URL instead of a link to the component with parameters => fine.

But when uddeIM select the corresponding URL from the _MENU table in Joomla database, it does not restrict the query by the current site language, and so the first one is used to build the URL, regardless of current site language. This results in invalid URLs for the link to the inbox when current site language is different to the one of this first menu item.

E.g.
German:

https://localhost/joomla2/de/mitglieder/private-botschaften.html?task=inbox

=> OK
English:

https://localhost/joomla2/en/mitglieder/private-botschaften.html?task=inbox

=> Erroneous

I could help myself by making one global uddeIM menu item on a hidden menu and make the others being menu item aliases to them.

But before Joomla 2.5 menu item aliases did not have associations, and so when I am on the uddeIM inbox for example and change language, I get to the home page of the selected language => not nice.

Meanwhile menu items have aliases, but still I get to the home page and not stay on the udeeIM inbox when I am on the uddeIM inbox and change the site language with the Joomla language switcher.

For Community Builder's link to the uddeIM inbox in the cb_login module and the cb_profile menu I have made a suggestion for a fix, and this then was implemented with some modifications for safer SQL with the step from CB1.8 RC2 to CB1.8 (final).

See following thread in the CB professional member support forum:

TOPIC: [#3293] Language-spefic URLs do not work

I will see if I can make a proposal for a solution for uddeIM, too, here in this topic, but I cannot promise to find a quick one.

Can you check if what I described here is worth to be fixed and give me some feedback here?

Or do you regard this to be a Joomla bug that I get to the current home page when I am on the uddeIM inbox and change the site language with the Joomla language switcher?

In this case then at least the uddeIM document should be adapted to CLEARLY tell that there should be only 1 uddeIM menu item for ALL languages on a multilingual site, which can be referred then to by menu item aliases.

Thanks in advance,

Richard
Last edit: 12 years 8 months ago by Richard67. Reason: corrected link to CB forum topic

Please Log in or Create an account to join the conversation.

  • slabbi
  • slabbi
  • OFFLINE
  • Posts: 3709
  • Thanks: 250
  • Karma: 153
12 years 8 months ago #193925 by slabbi
Well, you are right. Multilingual sites with Joomla are quite new, so I will postpone uddeIM 2.7 release until this issue is fixed.

So the code to get the Itemid should be:

$lang = &JFactory::getLanguage();
$itemid = "SELECT id FROM #__menu WHERE published>0 AND link LIKE '%com_uddeim%' AND language IN (" . $database->Quote($lang->get('tag')) . ",'*')";

Does this also work on Joomla 1.5?

If so uddeIM can be fixed qute simple:

In includes.db.php the function
function uddeIMgetItemid($config) {
}
must be changed and of course in all modules and plugins.

uddeIM & uddePF Development
CB Language Workgroup
CB 3rd Party Developer

Please Log in or Create an account to join the conversation.

  • Richard67
  • Richard67
  • OFFLINE
  • Posts: 30
  • Thanks: 1
  • Karma: 0
12 years 8 months ago #193926 by Richard67
Hi slabbi,

well, I think it will not work on Joomla 1.5, so you should use uddeIMcheckJversion() and check if version is greater than 1 (or greater equal 2).

But shouldn't it be done with ALL queries to the menu table?

In includes.db.php in functions "uddeIMgetItemid" and "uddeIMgetItemidComponent",

in the "getItemid" function of the "uddeIMAPI" class in uddeim.apo.php, and

in mod_uddeim.php in those 2 queries in lines 137 and 143?

Best regards,

Richard

Please Log in or Create an account to join the conversation.

  • Richard67
  • Richard67
  • OFFLINE
  • Posts: 30
  • Thanks: 1
  • Karma: 0
12 years 8 months ago - 12 years 8 months ago #193927 by Richard67
Hi again, slabbi,

here an example for the first query in mod_uddeim.php how I would do it:
Code:
$lang = &JFactory::getLanguage(); $udd_sql="SELECT id FROM #__menu WHERE link LIKE '%com_uddeim%' AND published=1 AND access". ($udd_mygroupid==0 ? "=" : "<=").$udd_mygroupid; if (uddeIMcheckJversion()>=2) { // J1.6 $udd_sql.=" AND language IN (" . $udd_database->Quote($lang->get('tag')) . ",'*')"; } $udd_sql.=" LIMIT 1";

I am just changing all files I mentioned above like this, if you want I can provide my changes then here either as code snippets inside a post or attach changed files.

Pls let me know if I shall do so.

Best regards,

Richard
Last edit: 12 years 8 months ago by Richard67. Reason: Corrected $database to $udd_database, added info which file changed

Please Log in or Create an account to join the conversation.

  • Richard67
  • Richard67
  • OFFLINE
  • Posts: 30
  • Thanks: 1
  • Karma: 0
12 years 8 months ago - 12 years 8 months ago #193928 by Richard67
Hello again, slabbi,

I have changed the files meanwhile and tested: It seems to work.

Of course I could not test everything, e.g. the API class.

I attach the changed files here.

File Attachment:

File Name: uddeIM_2.6...3928.zip
File Size:17 KB


The mod_uddeim.php includes also my change mentioned in
TOPIC: mod_uddeim produces invalid XHTML

Best regards,

Richard
Attachments:
Last edit: 12 years 8 months ago by Richard67.

Please Log in or Create an account to join the conversation.

  • slabbi
  • slabbi
  • OFFLINE
  • Posts: 3709
  • Thanks: 250
  • Karma: 153
12 years 8 months ago #193931 by slabbi
I have modified the complete code, now.

Someone uses cb_plug_pms_uddeim_inbox and can test it on Joomla 1.6 and above?

Note: I have not used the code from the postings above since it will not work on Joomla 1.0.

uddeIM & uddePF Development
CB Language Workgroup
CB 3rd Party Developer

Please Log in or Create an account to join the conversation.

Moderators: beatnantslabbikrileon
Powered by Kunena Forum