Commit d1e94e8b authored by Sigrid Suski's avatar Sigrid Suski
Browse files

(#) Editing entry in multi-lingual mode always change main language (Issue #115)

parent a40f5cd1
......@@ -62,6 +62,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
(#) Wrong icon class syntax in category edit screen in back-end
(#) Application installation in 'media:' does not work
(#) Reverting solution for issue #77 as it breaks the usage of HTML code in the description
(#) Editing entry in multi-lingual mode always change main language (Issue #115)
### 1.4.7.3 (11 May 2018)
......
......@@ -791,7 +791,8 @@ class SPField_Category extends SPFieldType implements SPFieldInterface
}
/* if it wasn't edited in the default language, we have to try to insert it also for def lang */
if ( Sobi::Lang() != Sobi::DefLang() ) {
/* 30 August 2018, Sigrid: if the entry wasn't ADDED in the default language, we have to insert it also for the default language */
if ( ( Sobi::Lang() != Sobi::DefLang() ) && ( $entry->get( 'version' ) == 1 ) ) {
$params[ 'lang' ] = Sobi::DefLang();
try {
$db->insert( 'spdb_field_data', $params, true, true );
......
......@@ -314,7 +314,8 @@ class SPField_Email extends SPField_Url implements SPFieldInterface
}
/* if it wasn't edited in the default language, we have to try to insert it also for def lang */
if ( Sobi::Lang() != Sobi::DefLang() ) {
/* 30 August 2018, Sigrid: if the entry wasn't ADDED in the default language, we have to insert it also for the default language */
if ( ( Sobi::Lang() != Sobi::DefLang() ) && ( $entry->get( 'version' ) == 1 ) ) {
$params[ 'lang' ] = Sobi::DefLang();
try {
$db->insert( 'spdb_field_data', $params, true, true );
......
......@@ -204,6 +204,7 @@ class SPField_Inbox extends SPFieldType implements SPFieldInterface
$data = null;
}
$this->setData( $data );
return $data;
}
......@@ -280,7 +281,8 @@ class SPField_Inbox extends SPFieldType implements SPFieldInterface
}
/* if it wasn't edited in the default language, we have to try to insert it also for def lang */
if ( Sobi::Lang() != Sobi::DefLang() ) {
/* 30 August 2018, Sigrid: if the entry wasn't ADDED in the default language, we have to insert it also for the default language */
if ( ( Sobi::Lang() != Sobi::DefLang() ) && ( $entry->get( 'version' ) == 1 ) ) {
$params[ 'lang' ] = Sobi::DefLang();
try {
$db->insert( 'spdb_field_data', $params, true, true );
......@@ -427,6 +429,7 @@ class SPField_Inbox extends SPFieldType implements SPFieldInterface
catch ( SPException $x ) {
Sobi::Error( $this->name(), SPLang::e( 'CANNOT_SEARCH_DB_ERR', $x->getMessage() ), SPC::WARNING, 0, __LINE__, __FILE__ );
}
return $terms;
}
......@@ -451,6 +454,7 @@ class SPField_Inbox extends SPFieldType implements SPFieldInterface
catch ( SPException $x ) {
Sobi::Error( $this->name(), SPLang::e( 'CANNOT_SEARCH_DB_ERR', $x->getMessage() ), SPC::WARNING, 0, __LINE__, __FILE__ );
}
return $sids;
}
......@@ -464,6 +468,7 @@ class SPField_Inbox extends SPFieldType implements SPFieldInterface
}
else {
$request = preg_quote( $request );
return $this->search( "REGEXP:^{$request}$", $section );
}
}
......
......@@ -332,7 +332,8 @@ class SPField_Textarea extends SPField_Inbox implements SPFieldInterface
}
/* if it wasn't edited in the default language, we have to try to insert it also for def lang */
if ( Sobi::Lang() != Sobi::DefLang() ) {
/* 30 August 2018, Sigrid: if the entry wasn't ADDED in the default language, we have to insert it also for the default language */
if ( ( Sobi::Lang() != Sobi::DefLang() ) && ( $entry->get( 'version' ) == 1 ) ) {
$params[ 'lang' ] = Sobi::DefLang();
try {
$db->insert( 'spdb_field_data', $params, true, true );
......
......@@ -566,7 +566,8 @@ class SPField_Url extends SPField_Inbox implements SPFieldInterface
}
/* if it wasn't edited in the default language, we have to try to insert it also for def lang */
if ( Sobi::Lang() != Sobi::DefLang() ) {
/* 30 August 2018, Sigrid: if the entry wasn't ADDED in the default language, we have to insert it also for the default language */
if ( ( Sobi::Lang() != Sobi::DefLang() ) && ( $entry->get( 'version' ) == 1 ) ) {
$params[ 'lang' ] = Sobi::DefLang();
try {
$db->insert( 'spdb_field_data', $params, true, true );
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment