videokid Posted July 28, 2013 Share Posted July 28, 2013 Recoverable Fatal Error: Argument 2 passed to LanguageSupportPageNames::getPagePath() must be an instance of Language, boolean given, called in 'baseUrl'\wire\modules\LanguageSupport\LanguageSupportPageNames.module on line 324 and defined (line 183 of 'baseUrl'\wire\modules\LanguageSupport\LanguageSupportPageNames.module) I wanted to test out the mulit-lang thingie, not sure if I did something wrong here... Regards! Link to comment Share on other sites More sharing options...
Wanze Posted July 29, 2013 Share Posted July 29, 2013 Hi videokid, Can you also post the code-snippet that is responsible for this error? Thanks Link to comment Share on other sites More sharing options...
videokid Posted July 29, 2013 Author Share Posted July 29, 2013 Hi Wanze, sure, but actually it's not a code-snippet.I just try to add a child-page to a page, using 'Languages Support - Page Names'. I have two languages: - default -> Nederlands [and it seems I can't change default, unless in a hacky way phpMyAdmin] - en -> English and although Dutch is default, in the 'new' field for Dutch the URL starts with: /start/films/ and for English /movies/ when hitting 'save' then the error occurs. Thank you in advance. Link to comment Share on other sites More sharing options...
Wanze Posted July 29, 2013 Share Posted July 29, 2013 - default -> Nederlands [and it seems I can't change default, unless in a hacky way phpMyAdmin] The name of the default language can't be changed in Pw, but the title. If you have changed 'default' to something else in phpMyAdmin, then maybe that's causing the error? Try to change the value to 'default' again. and although Dutch is default, in the 'new' field for Dutch the URL starts with: /start/films/ and for English /movies/ Check the name fields in your home-page (under the settings tab). I guess that the Dutch name has the value 'start' there. 1 Link to comment Share on other sites More sharing options...
videokid Posted July 29, 2013 Author Share Posted July 29, 2013 The name of the default language can't be changed in Pw, but the title. If you have changed 'default' to something else in phpMyAdmin, then maybe that's causing the error? Try to change the value to 'default' again. Check the name fields in your home-page (under the settings tab). I guess that the Dutch name has the value 'start' there. I just did that in my first PW installation, just to see how fast I could mess it up :-D, this installation is pretty standard and has a 'default' language, I did change it to 'Nederlands' and added a new language 'English' with the name 'en'. Yes, correct 'start' is the Dutch version for 'home', but I've read somewhere on the forum the default language doesn't need a 'prefix', so Dutch is my default language, basicly I was expecting this: www.domain.com/films/ www.domain.com/en/movies/ Thank you so far for the answers and tips! Link to comment Share on other sites More sharing options...
videokid Posted July 29, 2013 Author Share Posted July 29, 2013 OK after writing my previous post I took a different approach... page id 1 = start I've changed the settings, instead of 'start' & 'home' I've changed it to 'nl' and 'en'. So, now I have -Start {8} |-> Films {2} |-> Camping Cosmos |-> Assault on Wall Street Nederlands /nl/films/assault-on-wall-street/ English /en/movies/assault-on-wall-street/ so the basic url structure makes way more sense. However, every link results in a 404 Page Not Found + adding new content still results in the same error report in my initial post. Thx for reading this! Link to comment Share on other sites More sharing options...
ryan Posted July 30, 2013 Share Posted July 30, 2013 I think you might be using some version of ProcessWire older than 2.3.2 (dev), because the line numbers indicated in your error message don't line up with the line numbers in the dev source. I would replace your /wire/ directory with the one from the dev branch (ProcessWire 2.3.2) and try again. I don't recommend using LanguageSupportPageNames from 2.3.0 just because 2.3.2 is so much farther along in that regard. Link to comment Share on other sites More sharing options...
videokid Posted July 31, 2013 Author Share Posted July 31, 2013 Hi Ryan, I was using 2.3.0 [the stable version]. I did what you suggested, but the error remains: Recoverable Fatal Error: Argument 2 passed to LanguageSupportPageNames::getPagePath() must be an instance of Language, boolean given, called in ......\wire\modules\LanguageSupport\LanguageSupportPageNames.module on line 504 and defined (line 288 of ......\wire\modules\LanguageSupport\LanguageSupportPageNames.module) Regards! Link to comment Share on other sites More sharing options...
ryan Posted August 3, 2013 Share Posted August 3, 2013 It sounds like something is wiping out the $user->language variable. Do you have any code that is setting $user->language in your site? Are there any other 3rd party modules installed that have to do with multi-language? If not, try replacing your /wire/modules/LanguageSupport/LanguageSupportPageNames.module file with the one attached--please let me know what you find? LanguageSupportPageNames.module Link to comment Share on other sites More sharing options...
videokid Posted August 3, 2013 Author Share Posted August 3, 2013 There are no 3rd party multi-language modules installed [actually pretty basic installation], I do however have a little code snippet in my _init.php file if ($modules->isInstalled('LanguageSupport')) { $lang = ($user->language->name == 'default' ? 'nl' : $user->language->name); }else{ $lang = 'nl'; } I've replaced the LanguageSupportPageNames.module with the one provided and the error seems to be gone. Hence my question somewhere if I could change the name 'default', now it makes more sense to me why it's unchangable... I wanted to make my life a bit easier on future installations and get rid of the language thingie, if I need a multi-lang website, I just install one [or more] languages and call the '$lang' when needed Again, thanks for the follow up and the quick response! Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now