deuxhuithuit / multilingual_field Goto Github PK
View Code? Open in Web Editor NEWMultilingual Textbox field for Symphony CMS
Home Page: http://symphonyextensions.com/extensions/multilingual_field/
License: Other
Multilingual Textbox field for Symphony CMS
Home Page: http://symphonyextensions.com/extensions/multilingual_field/
License: Other
As this bug seems quite hard to explain I've created a litte "screenshot story" of what's going wrong with the multilingual field compared to the way it used to work.
My Setups are:
On the left:
On the right:
I also tried older versions of Text Box Field as well as the new "Association Field" instead of SBL in S2.5. The problems are the same. I haven't tested what's going on in S2.4 though.
I also haven't tested yet if this affects filtering multilingual values too, but I guess it does.
I've centered some images when both versions do the same:
This check:
if( $this->get('def_ref_lang') === 'yes' && $data['value-'.$lang_code] === '' )
won't work because (in my case) $data['value-'.$lang_code]
is NULL
. Do you think changing all those checks in a more loosely form, like this:
if( $this->get('def_ref_lang') === 'yes' && !$data['value-'.$lang_code] )
would be a good idea?
The text limit feature only display the good number of remaining characters of the default (first) language.
It stills validates on the server side if one of the languages value is too big. This confuses my clients a lot so I may try to fix it in the near future if you don't have time to do it.
I'm upgrading a site built on Symphony 2.2.5 to 2.3 and in 2.2.5 we used version 1.4 of your extension. I'm getting this error and unsure how to get things working:
14 August 2012 11:45 > UNKNOWN: GenericExceptionHandler 0 - Could not find Field <code>multilingual</code> at <code>/field.multilingual.php</code>. If it was provided by an Extension, ensure that it is installed, and enabled. in file /Users/jdsimcoe/Sites/athey-beta/symphony/lib/toolkit/class.fieldmanager.php on line 524
Here is a screenshot: http://d.pr/i/Jl8h
If the first field of a section is a multilingual text box and you save an entry leaving this field empty you can't go back to edit mode from clicking on the entry.
The expected behaviour is that of the core text input field which outputs "none" in the entries list and links that to the edit form.
I have two setups, both uses version 2.1 but one still has the option and the other one does not. Both uses Frontend localisation 1.7.1
What's up with that ?
In the section builder page, when you select only one language in the required language field, the message displayed in the entry builder page is "Optionnal" but it ain't.
It would be nice if it was written "Required in French" or "Required in Main Language [French]" or "Optionnal, exept for French"
👍 #️⃣ 🐸
Hi there, I'm using symphony 2.5.2 with frontend localisation 2.6.0 and multilingual text box 3.4.0, and when I edit or create a multilingual text box field, I can't see the checkbox "Display in entries table".
So these fields aren't displayed on entries table.
Do you have this issue?
I updated Symphony CMS to 2.7.0 and switched to PHP 7. When updating the multilingual text box field, I get a fatal error:
Symphony Fatal Error: Call to undefined method Extension_TextBoxField::updateHasUniqueKey()
An error occurred in /var/www/vhosts/profitlich.ch/httpdocs/extensions/multilingual_field/extension.driver.php around line 141
136 if (!$textboxExt->updateHasColumn('handle_unique', self::FIELD_TABLE)) {
137 $textboxExt->updateAddColumn('handle_unique', "ENUM('yes', 'no') NOT NULL DEFAULT 'yes' AFTER `text_handle`", self::FIELD_TABLE);
138 }
139
140 // add field_id unique key
141 if ($textboxExt->updateHasColumn('field_id', self::FIELD_TABLE) && !$textboxExt->updateHasUniqueKey('field_id', self::FIELD_TABLE)) {
142 $textboxExt->updateAddUniqueKey('field_id', self::FIELD_TABLE);
143 }
144
145 // add entry_id unique key
Backtrace
[/var/www/vhosts/profitlich.ch/httpdocs/symphony/lib/toolkit/class.extensionmanager.php:367]
Extension_Multilingual_Field->update();
[/var/www/vhosts/profitlich.ch/httpdocs/symphony/content/content.systemextensions.php:284]
ExtensionManager::enable();
[/var/www/vhosts/profitlich.ch/httpdocs/symphony/lib/toolkit/class.administrationpage.php:793]
contentSystemExtensions->__actionIndex();
[/var/www/vhosts/profitlich.ch/httpdocs/symphony/lib/toolkit/class.administrationpage.php:756]
AdministrationPage->__switchboard();
[/var/www/vhosts/profitlich.ch/httpdocs/symphony/lib/toolkit/class.administrationpage.php:459]
AdministrationPage->action();
[/var/www/vhosts/profitlich.ch/httpdocs/symphony/lib/core/class.administration.php:205]
AdministrationPage->build();
[/var/www/vhosts/profitlich.ch/httpdocs/symphony/lib/core/class.administration.php:483]
Administration->__buildPage();
[/var/www/vhosts/profitlich.ch/httpdocs/symphony/lib/boot/func.utilities.php:253]
Administration->display();
[/var/www/vhosts/profitlich.ch/httpdocs/symphony/lib/boot/func.utilities.php:235]
symphony_launcher();
[/var/www/vhosts/profitlich.ch/httpdocs/index.php:19]
symphony();
Database Query Log
[0.0004] SET character_set_connection = 'utf8', character_set_database = 'utf8', character_set_server = 'utf8';
[0.0001] SET CHARACTER SET 'utf8';
[0.0001] SET time_zone = '+02:00';
[0.0003] SELECT SQL_CACHE t1.name, t2.page, t2.delegate, t2.callback FROM `sym_extensions` as t1 INNER JOIN `sym_extensions_delegates` as t2 ON t1.id = t2.extension_id WHERE t1.status = 'enabled' ORDER BY t2.delegate, t1.name;
[0.0003] SELECT SQL_CACHE `name` FROM `sym_extensions` WHERE `status` = 'enabled';
[0.0002] SELECT SQL_CACHE `session_data` FROM `sym_sessions` WHERE `session` = 'buo56o3qjb90ak8kn17dk14425' LIMIT 1;
[0.0002] SELECT SQL_CACHE * FROM `sym_extensions`;
[0.0003] SELECT SQL_CACHE a.* FROM `sym_authors` AS `a` WHERE `username` = 'mprofitl' ORDER BY a.id ASC LIMIT 1;
[0.0004] UPDATE sym_authors SET `last_seen` = '2017-08-13 16:34:20' WHERE `id` = 1;
[0.0008] SELECT SQL_CACHE `s`.* FROM `sym_sections` AS `s` ORDER BY `s`.`sortorder` asc;
[0.0012] SHOW COLUMNS FROM `sym_fields_multilingual_textbox` WHERE Field = 'handle_unique';
[0.0006] SHOW COLUMNS FROM `sym_fields_multilingual_textbox` WHERE Field = 'field_id';
In extension.driver.php
line 120 is
$language_codes = explode(',', $_POST['settings']['language_redirect']['languages_codes']);
it should be
$language_codes = explode(',', $_POST['settings']['language_redirect']['language_codes']);
Thanks, Guillem.
I guess $v1x_table = 'tbl_fields_multilingual_textbox';
in the update()
function should be $v1x_table = 'tbl_fields_multilingual';
to reference the old table name?
Generally I'm a strong proponent of unique handles, but it's not useful in every situation.
For example, I'm currenlty developing an application for location listings. The URL structure should be something like /country/city/...
. Uniqueness is already created by tying a city to other modifiers like country
, region
, etc. But since all cities are still in one section, it's very likely to have two or more cities in different countries or regions sharing the same name, which creates unwanted unique handles like /country/city-2/
.
There is a range of new multilingual_* fields that appeared for Symphony:
All these fields, and others if necessary, use the same idea of Language Tabs from this extension.
I'm not that skilled in JS and came up with a crude implementation that I was hoping will not conflict with Multilingual Field's js code.
Today (Friday 27 Jan 2012), @Thomas aka iwyg proposed a very neat solution for the JS implementation for Language Tabs.
I thought you might want to adopt it as well. Here's the discussion.
On fresh symphony install 2.6.7 and Multilingual field / textbox latest version, my html gets encoded in formated mode.. Didn't have this in Multilingual field 3.3.2.
(In the database the html is ok.)
Hi,
Multilingual Textbox uses static method FLang::getAllLangs() which is missing in a release 2.0 of Frontend Localisation module.
Symphony Warning: Declaration of Extension_Multilingual_Field::update($prev_version) should be compatible with Extension::update($previousVersion = false)
cc @PascalPiche
Please check out this post and integrate if necessary.
Thank you.
I just tried your extension on symphony 2.2RC2 and it' doesn't work. Are you planning on releasing a new version soon?
I just installed a fresh copy of this extensions and when I save a section, I get this error.
Hopefully, vlad's rewrite won't have this bug, I am going to give it a try right now...
Hi, Guillem.
There is a recent issue with your field. Check out this post for more details.
Thank you for looking into it.
This is a feature request :-)
In a recent project I hacked a new mode : all
to the old version of this field to be able to replicate the backend behaviour for multi-language frontend submission. I just looped over each supported language and add the raw output to a <language>
element. This is of course useful for the other multilingual fields. Maybe @vlad-ghita knows a way to add it to all multlingual fields? I haven't had a proper look into all those extensions.
Filtering DS by this field doesn't work, also it doesn't work with select box and select box link. All this functionaities are looking for value
in database tables, but this extension uses value-{$lang}
column names.
Extension option Consolidate entry data
in Symphony's Preferences has no effect - preference can't be changed nor when changed manually in config.php
, it does not reflect the config's value (if no
means false
).
###### MULTILINGUAL_FIELD ######
'multilingual_field' => array(
'consolidate' => 'no',
),
########
There is a case that is left outside:
This is the new condition in extension.driver.php from line 180:
if ( ( $callback['driver'] == 'publish'
&& ( $callback['context']['page'] == 'new' || $callback['context']['page'] == 'edit') )
|| ( $callback['driver'] != 'publish' ) ){
....
}
If on a publish page, then make sure it is 'new' or 'edit' OR if on any other page (for example pages generated by extensions). Example Custom Preferences.
I have a client that reported she typed in only 60 characters when the limit is set to 70 and she had an error reporting that there was too many chars.
I looked deeper and found out that I needed to use mb_strlen(trim($value), 'utf-8')
instead of strlen($value)
in order to make it work.
This is a temporary fix and I want to check with you how can we make a change in the extension while preseving which encoding the programmers use and returning the right count.
This is not an heavy or often repeated method we are dealing with so there is not fear so calling mb_strlen.
Vlad,
Modifying just the current language value doesn't work on Symphony 2.3.6, 2.4, it saves the actual language field and empties the other language fields (Modify all values works.)
Doesn't work
Title
input name = "fields[title][value-{$url-fl-language}]" type ="text" />
Works
<!--Modify all values-->
<input name="fields[title][value-nl]" type="text" />
<input name="fields[title][value-en]" type="text" />
<input name="fields[title][value-fr]" type="text" />
<input name="fields[title][value-pt]" type="text" />
I'm working on a project with the multilingual field and I've set the required languages to the main language. In the current situation, the main language is french and my Symphony is set to English. Therefore, I can only see "None" in the entry list for the field because it cannot detect the current language.
So I thought it would be cool if it could display the value of the other language if no value in the current language is detected. It could be shown as "Foo Bar (Fr)".
Cheers!
When saving data with field that use CKEditor applied, Symphony warning appears:
strpos() expects parameter 1 to be string, array given
/Users/grzegorz/Sites/vimuseo.fi/www-2/symphony/lib/toolkit/class.general.php line 93
I think this happens because in function checkPostFieldData you are looping through languages, and then you are checking not each value, but all language data (extension checks 3 times same data for me - I'm using 3 languages)
line 606: if (!$this->applyValidationRules($data)) {
line 616: if ($length > 0 and $length < strlen($data)) {
line 627: if (!General::validateXML($this->applyFormatting($data), $errors, false, new XsltProcess)) {
line 627 is problematic in my case, I'm not sure, but when I changed in these 3 lines $data
to $value
everything works.
if you have multiple multilingual text boxes in a section the second tab will be active when you edit an entry. if only one field is present the first tab is active as you would expect.
Multilingual Text Box 3.2 Datasource filtering doesn't work for another languague other than the default language. Worked smoothly in the previous versions.
After upgrading textbox field everything worked smoothly.
I really do not know what cause this, I was running 1.3 at the time.
I did update to 1.4.1 but still no luck.
When I save/create an entry, I get Unknown column 'f.handle-fr' in 'where clause'
I think it may be related to the fact that we develop this backend specifying only one language. We did that because the client does not have a translator but wishes to translate its content later. So in LR, only one language was set.
I will investiguate more tomorrow.
Why did you include the LockedHandle feature ? Handle are not meant to be unique unless the 2nd parameter is set to true.
Uniqueness should be a 'per field' parameter. I would consider:
I loggued this as an issue, but I don't think it really is a bug. I can fork and update if you don't wanna do (or can't) do the changes.
I would also update this extension to the new version of Language Redirect extension, which as a pretty clever class, LanguageRedirect, that holds all the language and much more!
When something other than "All" is selected (i.e."main language"). After saving the modification the the section, it seemd to lose the selected value and revert back to "All"
There is a JS issue when an input / textarea has CKEDitor selected. Character counter will not work no more.
Can you, please, have a look? It seems that $input.bind('blur', $update)
events are not triggering.
Thank you,
Vlad
Update:
Seems that counting won't work in TinyMCE either.
I tried using XML Importer into this, it failed at line 527. I don't know if it is feasible to use XML Importer with the Multilingual fields? Thanks.
522 if (!isset($data[$lc]) && $entry_id) {
523 continue;
524 }
525
526 // if one language fails, all fail
527 if (self::OK != parent::checkPostFieldData($data[$lc], $file_message, $entry_id)) {
528
529 $local_msg = "
[$lc] {$all_langs[$lc]}: {$file_message}";
530
531 if ($lc === $main_lang) {
This one slipped your updates. In extension.driver.php, change line 120 from
$language_codes = explode(',', $_POST['settings']['language_redirect']['languages']);
to
$language_codes = explode(',', $_POST['settings']['language_redirect']['language_codes']);
Thanks!
When editing"creating an entry, it would be interesting to know that the "use main language value" is checked for this field.
I've noticed that the field options seem to be ignore, i.e. 'Output as CDATA' and 'Use value from main language if selected language has empty value.'. Irrelevant of what's selected it seems to output the same.
Most importantly the fallback option, 'Use value from main language if selected language has empty value.' doesn't seem to work.
This is in the latest build in Symphony 2.3.1
I just noticed that I cannot show the multilingual field in the entries table anymore because the "display in entries table"-checkbox has vanished.
Setup: Multilingual Field 3.3.1 / Symphony 2.5.0beta2
From the forum:
"Multilingual field doesn’t specify a charset when creating a table and that’s why server uses default latin2. "
Could you please add default encoding set to UTF-8?
Thank you
[Sun Apr 07 22:52:34 2013] [warn] [client 188.25.62.4] mod_fcgid: stderr: PHP Fatal error: Undefined class constant 'SETTING_HEADERS' in /home/user/public_html/extensions/multilingual_field/extension.driver.php on line 225, referer: http://archibus.thewizards.ro/symphony/publish/articles/
Issue:
Unlike Text Box, handles are returned always unique, whether the Handles are unique
option is selected or not.
Expected:
Handles should be able to not to be unique.
(Edited) Use case:
I get unwanted suffixes into page URL
s which are build from ML TB handles.
Hi @6ui11em,
One of our programmers created some multilingual fields BEFORE setting a language code.
After setting the default language, all of those fields are not working, i.e., the value-lc colunm always contains 0. Other columns (value_formatted-, word_count-, handle- ) are working. Fields created after that are working just fine.
I went in the DB to check if I could spot the issue but could not find anything.
The only thing I see is the typecast you do to force string type at line 381.
Is that necessary ?
Another thing is the re-use of the $data variable inside the loop. Maybe declaring a variable inside the loop block woul be better ?
Thanks !
I get this error
Table 'dev_vs.sym_fields_multilingual_textbox' doesn't exist in query "SELECT SQL_CACHE field_id FROM sym_fields_multilingual_textbox
"
If I manually rename the table, I get this error
MySQL Error (1050): Table 'sym_fields_multilingual_textbox' already exists in query "RENAME TABLE sym_fields_multilingual
TO sym_fields_multilingual_textbox
;"
Looks like a dead end...
i've got installed Field: Multilingual Text v. 1.3, Order Entries v.1.9.6, Publish Filtering v.1.6.1 in Symphony 2.2.3.
in a section with two Multilingual Fields and one Order Entries field firebug logs error:
activeTab.attr("class") is undefined
this.setActiveTab(activeTab.attr('class').split(' ')[0]);
in multilingual_field.publish.js, line 63.
Moreover, i can't drag entries to reorder and Publish filtering is hidden.
If the value is empty for the current language (but has a value in the main one), it does not uses the other main value as the sorting field.
I do not think it's fixable (since sorting in down on the database) two things could be tried:
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.