Jump to content

Can´t install LanguageSupport


alejandro
 Share

Recommended Posts

Hello,

I think I installed the ProccessLanguage module before installing LanguageSupport. Now while trying to install it, an error is shown:

TemplateFile: Unable to install module 'LanguageSupport': SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'languages-22' for key 'name_parent_id'<pre>#0 [internal function]: Modules->___install('LanguageSupport') #1 ...... (continues)

I've uninstalled Processlanguage but throws the same error anyway, and it seems to install it again:

LanguageSupportInstall: Installed ProcessLanguage

although I've even deleted it from /wire/modules/LanguageSupport.

¿?

The PW version running is 2.4.10, tried again downgrading to 2.4 and behaves identically.

Thanks in advance, Alejandro.

Link to comment
Share on other sites

I am surprised you were able to install ProcessLanguage before LanguageSupport since it is listed as a requirement. ProcessLanguage is normally installed automatically. I did just test installing ProcessLanguage on 2.4.10 and weirdly it doesn't tell me it can't install, but then it doesn't actually do anything either - the confirmation alert pops up, but then nothing happens.

I'll make sure Ryan knows about this, but for the moment, your best way to get things going again might be to remove the language modules from the PW modules database table, and potentially also the relevant rows from the pages table - look for anything language related there.  Maybe even drop the entire field_language and field_language_files tables. Are you comfortable with PHPMyAdmin or similar for managing DB tables?

I am certainly no multi-language expert, so you might get a better solution from someone else. If you do take this approach and the site contains any important data, please do a complete backup first.

  • Like 1
Link to comment
Share on other sites

Alejandro, any idea how you were able to install ProcessLanguage before LanguageSupport? I've been here trying to figure out how that might have happened, but I can't find any paths that let me do it. Even the API will halt the operation. Clearly there must be some path to do it though, as otherwise I don't think you could have gotten that error. 

I don't have an install button for ProcessLanguage either (that doesn't appear until the dependencies are met). Adrian it sounds like you might have clicked on the module title, as there's no Install button present. A default javascript action will still pop-up if you click on it, but it's got nothing to do since there is no install button. If there's any confusion coming from that, I think we'll just drop that javascript action, as I don't think it's even translatable at present... and it's not had much purpose ever since we moved install has been a separate button.

Link to comment
Share on other sites

Mmm...

I´ve been messing between local and remote installs of the site, and additionally alternating between PW dev and master versions, installed and uninstalled the Language Support Module, using the profile export module... I don´t really know what I´ve done. Daring guy here I guess... but:

1) I don´t know if ProcessLanguage is really installed, but when trying to install "Language support" the message shows:

 LanguageSupportInstall: Installed ProcessLanguage
===================================================
 TemplateFile: Unable to install module 'LanguageSupport': SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'languages-22' for key 'name_parent_id'<pre>#0 [internal function]: Modules->___install('LanguageSupport') ....... 

2) Under Admin > Setup there is a "Language" page that perhaps is causing problems, but I don´t know how to delete it.

3) Opening the exported Site Profile and deleting "every" reference to "language", and installing a new fresh site with this profile seems to solve the problem.
 
I think the problem is somewhere in the database tables, where I deleted every reference to languages as well but it didn´t work either...
Link to comment
Share on other sites

2) Under Admin > Setup there is a "Language" page that perhaps is causing problems, but I don´t know how to delete it.

Just go to the "pages" tree. Click on "admin" then on "setup" and there should be a page called "Language" which you have to delete (delete = click on the page, choose edit, go to delete tab...)

Link to comment
Share on other sites

Aaaaand, deleted!

Thanks :)

... but it wasn´t the obstacle to install Language support. The initial issue persists, but now the error message has changed:

LanguageSupportInstall: Installed ProcessLanguage
-----------------------------------------------
 TemplateFile: Unable to install module 'LanguageSupport': Field may not be named 'language_files' because it is already used by another field<pre>#0 [internal function]: Modules->___install('LanguageSupport') #

I'm going to examine the database again.

Link to comment
Share on other sites

Yeah so you have to delete this field to manually. 

Somehow like this is there no delete tab, too.

<?php
$field = $fields->get('name=language_files');
field->status = Page::statusSystemOverride;
field->status = 0;
field->delete();
?>
Link to comment
Share on other sites

pag have status

feild have flags

$f = $fields->get( 'language_files' );
$f->flags = Field::flagSystemOverride;
$f->flags = 0;
$fields->delete($f);

u see.all fun here https://github.com/ryancramerdesign/ProcessWire/blob/dev/wire/modules/LanguageSupport/LanguageSupportInstall.php#L158

maybe.u just copy+run uninstall func.above ?

---

if u do put in non classy func, $this with wire() will u replace

// ex. replaces this
$field = $this->fields->get("language_files"); 

// w/this
$field = wire()->fields->get("language_files"); 
  • Like 5
Link to comment
Share on other sites

Solved, finally!

 Session: Module Install - LanguageSupport
 Session: Installed ProcessLanguage
 Session: Created field: language_files
 Session: Created fieldgroup: language (164)
 Session: Created Template: language
 Session: Created Default Language Page: /.....
 Session: Installed ProcessLanguageTranslator
 Session: Created Language Translator Page: /.....
 Session: Created Langage Field: language
 Session: Added field 'language' to user profile
 Session: Added default language to 41 user profiles
 Session: Language Support Installed! Click to the 'Setup' menu to begin defining languages.
 Session: Module Auto Install: ProcessLanguage

Deleting everything, seems to be the solution.

Thank you all for your help.

  • Like 1
Link to comment
Share on other sites

  • 1 year later...

Hi alejandro, hi WillyC,

I've got the same problem. It says:

language3.jpg

I can uninstall ProcessLanguage through the Module configuration, but it doesn't help. If I then try to install LanguageSupport it installs ProcessLanguage first, but doesn't install LanguageSupport...

I already deleted Languages Page I found in the Setup, but it didn't change anything.

I'm using the Blue-VR Site Profile made by Gayan Virajith, if that information helps.

I know you solved the problem already, but I'm still a beginner and don't really understand the solution mentioned.

How exactly can I use this uninstall function? Where do I have to put the code in to run it?

Thanks a lot already,

Leo

Link to comment
Share on other sites

  • 2 weeks later...
  • 3 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...