Content Language --> Config not saved

This forum is dedicated to the Joom!Fish 2.2.x core release. This release is dedicated to Joomla 1.5 code base and therefore we will not answer any questions related Joomla 2.5+ here.

Content Language --> Config not saved

Postby danielmauch on Fri Feb 17, 2012 12:22 pm

JoomFish Version V2.2.3

When I save something in Content Language --> Config the data is not stored! If I reopen the dialog the fields are empty. Even in the database the "params" field is empty !!

If i use this structure diretcly in the DB it works!?!?

offline_message=
sitename=
MetaDesc=
MetaKeys=
helpurl=http://help.joomla.org
mailfrom=
fromname=
defaulttext=




Ideas?
danielmauch
Newbee
 
Posts: 7
Joined: Mon Aug 10, 2009 10:26 am

Re: Content Language --> Config not saved

Postby danielmauch on Mon Feb 20, 2012 11:04 pm

the problem is in the form !!!!


Code: Select all
<form name="adminForm" method="post" action="index.php">
<input id="paramsfield" type="hidden" value="paramsValue2" name="paramsfield">
<input type="hidden" value="<br /> <b>Notice</b>: Undefined property: LanguagesViewLanguages::$language in <b>/Users/danielmauch/Sites/dualda/administrator/components/com_joomfish/views/languages/tmpl/translateconfig.php</b> on line <b>37</b><br /> <br /> <b>Notice</b>: Trying to get property of non-object in <b>/Users/danielmauch/Sites/dualda/administrator/components/com_joomfish/views/languages/tmpl/translateconfig.php</b> on line <b>37</b><br /> " name="lang_id">
<fieldset>
danielmauch
Newbee
 
Posts: 7
Joined: Mon Aug 10, 2009 10:26 am

Re: Content Language --> Config not saved

Postby nexusit on Fri Mar 16, 2012 3:18 pm

I have the problem too of content language settings not saved.
As a result, we cannot set the meta tags of the main page, which is kind of frustrating.

I understand that you've managed to solve the problem, however, could you please give me more description how to change it? I could not understand the solution
nexusit
Newbee
 
Posts: 3
Joined: Fri Mar 16, 2012 3:15 pm

Re: Content Language --> Config not saved

Postby quodo on Wed Apr 11, 2012 1:41 pm

Problem
With JoomFish 2.2.3 on Joomla 1.5 the meta tags are not translated.

Fix for JoomFish 2.2.3 - instructions
- Download the attached JF2.2.3_System_Configuration_fix.zip
- Unzip this: it'll give you four files, the two original and the two changed files, in the directory they belong to
- Upload these files to your server

Use meta tags
1 - Go to Backend > Components > JoomFish > Content Languages, you are now in the "Joom!Fish Language Manager" screen
2 - Click the icon in the Config column for the language you want to change the metatags for: a "Translate System Configuration" window pops up
3 - Fill in the settings and click Save in this "Translate System Configuration"
4 - Click Apply in the "Joom!Fish Language Manager" screen
--> Important: don't forget step 4, although you have clicked "a" save button in step 3, the changes need to be applied

This changes the
Code: Select all
  <meta name="keywords" content="joomla, Joomla" />
  <meta name="description" content="Joomla! - the dynamic portal engine and content management system" />

in the frontend HTML page source for each language.

Thank you goes to...
Klas has been doing some great work in JoomFish for Joomla 2.5.x. In that process he fixed the System Configuration that could not be saved/used. This was a similar problem as this one. His fix (see https://github.com/JoomFish/jf-future/issues/52) works on JoomFish 2.2.3 on Joomla 1.5.x as well.

Tested on...
- JoomFish 2.2.3 on Joomla 1.5.26. PHP 5.2.4, MySQL 5.1.41, Apache on CentOS
- JoomFish 2.2.3 on Joomla 1.5.26. PHP 5.2.9, MySQL 5.1.33, Apache on Windows
Attachments
JF2.2.3_System_Configuration_fix.zip
(16.55 KiB) Downloaded 303 times
quodo
Contributor
 
Posts: 561
Joined: Wed Feb 03, 2010 3:08 pm

Re: Content Language --> Config not saved

Postby nexusit on Thu May 10, 2012 11:58 am

Thank you!!! It worked as a charm
nexusit
Newbee
 
Posts: 3
Joined: Fri Mar 16, 2012 3:15 pm

Re: Content Language --> Config not saved

Postby kochin on Fri May 18, 2012 6:28 pm

My own investigation about this problem discovered 2 issues.

The first is a PHP short open tag was used in administrator/components/com_joomfish/views/languages/tmpl/translateconfig.php. Since my PHP configuration turns off the short_open_tag setting, this following line in that file returns an incorrect value.
Code: Select all
<input type="hidden" id="paramsfield" name="paramsfield" value="<?echo $this->paramsField;?>" />

Simply change that line to this one fixes the first part of the problem.
Code: Select all
<input type="hidden" id="paramsfield" name="paramsfield" value="<?php echo $this->paramsField;?>" />

The second issue is that Joom!Fish fails to properly bind configuration values to an newly created Joom!Fish language object after it determines the language for a page.

When the Joomla! starts processing a page, Joom!Fish loads configurations of all the languages from the database's language tables and stores them in the memory. Later when the language for the page is determined, it creates a new TableJFLanguage language object and binds configuration values in the memory to the newly created object.

However, the method bind in the file administrator/components/com_joomfish/tables/JFLanguage.php only correctly handles binding values from an array (returned by a database query). It fails to properly binds values from an existing TableJFLanguage object and loses metakey and metadesc during the process.

To fix it, modify the file administrator/components/com_joomfish/tables/JFLanguage.php as follows:
Code: Select all
--- JFLanguage.php.orig   2012-05-18 11:23:31.039770932 -0400
+++ JFLanguage.php   2012-05-18 11:41:40.018760039 -0400
@@ -407,7 +407,13 @@
       }
       
       // allow bind of aggregated objects
-      $this->jLanguageTable->bind($newValues);
+      // Kochin: The original code only works correctly when $newValues is an array,
+      //         but $newValues may be a TableJFLanguage object.
+      if (is_a($newValues, 'TableJFLanguage')) {
+         $this->jLanguageTable->bind($newValues->jLanguageTable);
+      } else {
+         $this->jLanguageTable->bind($newValues);
+      }
       // If the core language object includes special meta information we ensure those are stored in our parameter objcet
       $langParameter = new JParameter($this->params);
       $langParameter->set('MetaDesc', $this->jLanguageTable->get('metadesc'));
kochin
Contributor
 
Posts: 125
Joined: Sat Oct 27, 2007 2:00 pm

Re: Content Language --> Config not saved

Postby georgiagr on Sat May 19, 2012 12:21 pm

in which folder should i upload the files in my server?
georgiagr
Newbee
 
Posts: 4
Joined: Sat May 19, 2012 12:05 pm

Re: Content Language --> Config not saved

Postby quodo on Sat May 19, 2012 12:36 pm

Hi Kochin,

The second issue you mention, is that code that needs to be changed in addition to the changes marked by "//#System Configuration fix" in the files I attached in my previous post in this thread? Or is that a change that makes that fix unneccessary? I must admit that I don't understand what is happening 100%...

The first issue you mention, having a start PHP tag of <? instead of <?php, is "only" important when the server settings don't allow the use of the <? tag, isn't it? Joomla users can check their server settings via Backend > Help > System Info > PHP Information > [Find "short_open_tag", if it's "on" then it's not a problem, if it's "off" one should change the file as you mention it. Do I understand that correctly?
quodo
Contributor
 
Posts: 561
Joined: Wed Feb 03, 2010 3:08 pm

Re: Content Language --> Config not saved

Postby quodo on Sat May 19, 2012 12:40 pm

georgiagr,

There are four files in the zip, including two ending with original.php which you don't need, but I always like to have the original files available when making changes. These are the paths for the two files you need:
JOOMLAROOT/administrator/components/com_joomfish/models/languages.php
JOOMLAROOT/administrator/components/com_joomfish/models/JFLanguage.php
quodo
Contributor
 
Posts: 561
Joined: Wed Feb 03, 2010 3:08 pm

Re: Content Language --> Config not saved

Postby georgiagr on Sat May 19, 2012 12:53 pm

in my folder there is already a file with the name languages.php should i delete that or keep it? and just uploda the 2 files that you are saying?
thank you
georgiagr
Newbee
 
Posts: 4
Joined: Sat May 19, 2012 12:05 pm

Next

Return to Joom!Fish 2.2.x Core Extension

Who is online

Users browsing this forum: No registered users and 1 guest