Jump to content

Recoverable Fatal Error


videokid
 Share

Recommended Posts

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

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

- 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.

  • Like 1
Link to comment
Share on other sites

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

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

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

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

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

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

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...