Jump to content

Method NullPage::isDefault does not exist or is not callable in this context (in /wire/core/Wire.php line 320)


dragan
 Share

Recommended Posts

All of a sudden I get this error:

Error: Exception: Method NullPage::isDefault does not exist or is not callable in this context (in /wire/core/Wire.php line 320)
 
#0 /wire/modules/Fieldtype/FieldtypeDatetime.module(357): Wire->__call('isDefault', Array)
#1 /wire/modules/Fieldtype/FieldtypeDatetime.module(357): NullPage->isDefault()
#2 [internal function]: FieldtypeDatetime->___formatValue(Object(Page), Object(Field), 1366862400)
#3 /wire/core/Wire.php(359): call_user_func_array(Array, Array)
#4 /wire/core/Wire.php(317): Wire->runHooks('formatValue', Array)
#5 /wire/core/Page.php(714): Wire->__call('formatValue', Array)
#6 /wire/core/Page.php(714): FieldtypeDatetime->formatValue(Object(Page), Object
 
This error message was shown because you are logged in as a Superuser. Error has been logged.
 

PW 2.3.2 (latest dev version).

I have no idea what that means. Strangely enough, it used to work. I just do

echo $page->sidebar

nothing fancy there...

Link to comment
Share on other sites

Seems like it's an issue with your language settings.

There is an error with this part of FieldtypeDateTime.module

$this->user->language->isDefault())

Edit: Basically, $this->user->language is returning as a NullPage.

Link to comment
Share on other sites

That error seems to indicate that the system has language support installed (i.e. there is an $languages API variable), but the user's language is not set. That's unusual for it not to be set, so I would check in your code to make sure you aren't manually setting $user->language to an invalid value somewhere. 

Link to comment
Share on other sites

Thanks. I stumbled over a stupid oversight, where I called the default language by name ("de"), rather than "default" or some such.

But with the wonderful new 2.3.2 multilang handling, all this has become obsolete :)

Link to comment
Share on other sites

  • 8 years later...

I just somehow ran into this problem and find no way to fix - besides importing and old DB backup (probably).

Full error below:

Spoiler
DEBUG MODE BACKTRACE ($config->debug == true):
#0 /home/aca/www/webmanufaktur.test/wire/core/Page.php(1808): ProcessWire\Wire->___callUnknown()
#1 /home/aca/www/webmanufaktur.test/wire/core/Wire.php(420): ProcessWire\Page->___callUnknown()
#2 /home/aca/www/webmanufaktur.test/wire/core/WireHooks.php(951): ProcessWire\Wire->_callMethod()
#3 /home/aca/www/webmanufaktur.test/wire/core/Wire.php(485): ProcessWire\WireHooks->runHooks()
#4 /home/aca/www/webmanufaktur.test/wire/core/Wire.php(488): ProcessWire\Wire->__call()
#5 /home/aca/www/webmanufaktur.test/wire/core/PagesLoader.php(1390): ProcessWire\Wire->__call()
#6 /home/aca/www/webmanufaktur.test/wire/core/Pages.php(1140): ProcessWire\PagesLoader->getPath()
#7 /home/aca/www/webmanufaktur.test/wire/core/MarkupQA.php(544): ProcessWire\Pages->getPath()
#8 /home/aca/www/webmanufaktur.test/wire/modules/Fieldtype/FieldtypeTextarea.module(248): ProcessWire\MarkupQA->wakeupLinks()
#9 /home/aca/www/webmanufaktur.test/wire/modules/Fieldtype/FieldtypeTextarea.module(199): ProcessWire\FieldtypeTextarea->_htmlReplacement()
#10 /home/aca/www/webmanufaktur.test/wire/modules/Fieldtype/FieldtypeTextarea.module(142): ProcessWire\FieldtypeTextarea->htmlReplacements()
#11 /home/aca/www/webmanufaktur.test/wire/core/Wire.php(420): ProcessWire\FieldtypeTextarea->___loadPageField()
#12 /home/aca/www/webmanufaktur.test/wire/core/WireHooks.php(951): ProcessWire\Wire->_callMethod()
#13 /home/aca/www/webmanufaktur.test/wire/core/Wire.php(448): ProcessWire\WireHooks->runHooks()
#14 /home/aca/www/webmanufaktur.test/wire/core/Page.php(1392): ProcessWire\Wire->_callHookMethod()
#15 /home/aca/www/webmanufaktur.test/wire/core/Page.php(1084): ProcessWire\Page->getFieldValue()
#16 /home/aca/www/webmanufaktur.test/wire/modules/Fieldtype/FieldtypeRepeater/RepeaterPage.php(192): ProcessWire\Page->get()
#17 /home/aca/www/webmanufaktur.test/site/modules/FieldtypeRepeaterMatrix/RepeaterMatrixPage.php(45): ProcessWire\RepeaterPage->get()
#18 /home/aca/www/webmanufaktur.test/wire/core/Page.php(1742): ProcessWire\RepeaterMatrixPage->get()
#19 /home/aca/www/webmanufaktur.test/wire/core/Page.php(1596): ProcessWire\Page->getFormatted()
#20 /home/aca/www/webmanufaktur.test/wire/core/Wire.php(417): ProcessWire\Page->___getMarkup()
#21 /home/aca/www/webmanufaktur.test/wire/core/WireHooks.php(951): ProcessWire\Wire->_callMethod()
#22 /home/aca/www/webmanufaktur.test/wire/core/Wire.php(485): ProcessWire\WireHooks->runHooks()
#23 /home/aca/www/webmanufaktur.test/wire/core/WireTextTools.php(963): ProcessWire\Wire->__call()
#24 /home/aca/www/webmanufaktur.test/wire/core/Functions.php(449): ProcessWire\WireTextTools->populatePlaceholders()
#25 /home/aca/www/webmanufaktur.test/wire/core/Page.php(1568): ProcessWire\wirePopulateStringTags()
#26 /home/aca/www/webmanufaktur.test/wire/core/Wire.php(417): ProcessWire\Page->___getMarkup()
#27 /home/aca/www/webmanufaktur.test/wire/core/WireHooks.php(951): ProcessWire\Wire->_callMethod()
#28 /home/aca/www/webmanufaktur.test/wire/core/Wire.php(485): ProcessWire\WireHooks->runHooks()
#29 /home/aca/www/webmanufaktur.test/site/modules/FieldtypeRepeaterMatrix/InputfieldRepeaterMatrix.module(483): ProcessWire\Wire->__call()
#30 /home/aca/www/webmanufaktur.test/wire/core/Wire.php(423): ProcessWire\InputfieldRepeaterMatrix->___renderRepeaterLabel()
#31 /home/aca/www/webmanufaktur.test/wire/core/WireHooks.php(951): ProcessWire\Wire->_callMethod()
#32 /home/aca/www/webmanufaktur.test/wire/core/Wire.php(485): ProcessWire\WireHooks->runHooks()
#33 /home/aca/www/webmanufaktur.test/wire/modules/Fieldtype/FieldtypeRepeater/InputfieldRepeater.module(474): ProcessWire\Wire->__call()
#34 /home/aca/www/webmanufaktur.test/wire/modules/Fieldtype/FieldtypeRepeater/InputfieldRepeater.module(896): ProcessWire\InputfieldRepeater->buildForm()
#35 /home/aca/www/webmanufaktur.test/site/modules/FieldtypeRepeaterMatrix/InputfieldRepeaterMatrix.module(894): ProcessWire\InputfieldRepeater->___render()
#36 /home/aca/www/webmanufaktur.test/wire/core/Wire.php(414): ProcessWire\InputfieldRepeaterMatrix->___render()
#37 /home/aca/www/webmanufaktur.test/wire/core/WireHooks.php(951): ProcessWire\Wire->_callMethod()
#38 /home/aca/www/webmanufaktur.test/wire/core/Wire.php(485): ProcessWire\WireHooks->runHooks()
#39 /home/aca/www/webmanufaktur.test/wire/core/InputfieldWrapper.php(961): ProcessWire\Wire->__call()
#40 /home/aca/www/webmanufaktur.test/wire/core/Wire.php(420): ProcessWire\InputfieldWrapper->___renderInputfield()
#41 /home/aca/www/webmanufaktur.test/wire/core/WireHooks.php(951): ProcessWire\Wire->_callMethod()
#42 /home/aca/www/webmanufaktur.test/wire/core/Wire.php(485): ProcessWire\WireHooks->runHooks()
#43 /home/aca/www/webmanufaktur.test/wire/core/InputfieldWrapper.php(641): ProcessWire\Wire->__call()
#44 /home/aca/www/webmanufaktur.test/wire/core/Wire.php(414): ProcessWire\InputfieldWrapper->___render()
#45 /home/aca/www/webmanufaktur.test/wire/core/WireHooks.php(951): ProcessWire\Wire->_callMethod()
#46 /home/aca/www/webmanufaktur.test/wire/core/Wire.php(485): ProcessWire\WireHooks->runHooks()
#47 /home/aca/www/webmanufaktur.test/wire/core/InputfieldWrapper.php(961): ProcessWire\Wire->__call()
#48 /home/aca/www/webmanufaktur.test/wire/core/Wire.php(420): ProcessWire\InputfieldWrapper->___renderInputfield()
#49 /home/aca/www/webmanufaktur.test/wire/core/WireHooks.php(951): ProcessWire\Wire->_callMethod()
#50 /home/aca/www/webmanufaktur.test/wire/core/Wire.php(485): ProcessWire\WireHooks->runHooks()
#51 /home/aca/www/webmanufaktur.test/wire/core/InputfieldWrapper.php(641): ProcessWire\Wire->__call()
#52 /home/aca/www/webmanufaktur.test/wire/modules/Inputfield/InputfieldForm.module(163): ProcessWire\InputfieldWrapper->___render()
#53 /home/aca/www/webmanufaktur.test/wire/core/Wire.php(414): ProcessWire\InputfieldForm->___render()
#54 /home/aca/www/webmanufaktur.test/wire/core/WireHooks.php(951): ProcessWire\Wire->_callMethod()
#55 /home/aca/www/webmanufaktur.test/wire/core/Wire.php(485): ProcessWire\WireHooks->runHooks()
#56 /home/aca/www/webmanufaktur.test/wire/modules/Process/ProcessPageEdit/ProcessPageEdit.module(608): ProcessWire\Wire->__call()
#57 /home/aca/www/webmanufaktur.test/wire/modules/Process/ProcessPageEdit/ProcessPageEdit.module(573): ProcessWire\ProcessPageEdit->renderEdit()
#58 /home/aca/www/webmanufaktur.test/wire/core/Wire.php(414): ProcessWire\ProcessPageEdit->___execute()
#59 /home/aca/www/webmanufaktur.test/wire/core/WireHooks.php(951): ProcessWire\Wire->_callMethod()
#60 /home/aca/www/webmanufaktur.test/wire/core/Wire.php(485): ProcessWire\WireHooks->runHooks()
#61 /home/aca/www/webmanufaktur.test/wire/core/ProcessController.php(337): ProcessWire\Wire->__call()
#62 /home/aca/www/webmanufaktur.test/wire/core/Wire.php(414): ProcessWire\ProcessController->___execute()
#63 /home/aca/www/webmanufaktur.test/wire/core/WireHooks.php(951): ProcessWire\Wire->_callMethod()
#64 /home/aca/www/webmanufaktur.test/wire/core/Wire.php(485): ProcessWire\WireHooks->runHooks()
#65 /home/aca/www/webmanufaktur.test/wire/core/admin.php(160): ProcessWire\Wire->__call()
#66 /home/aca/www/webmanufaktur.test/wire/modules/AdminTheme/AdminThemeUikit/controller.php(15): require('/home/aca/www/w...')
#67 /home/aca/www/webmanufaktur.test/site/templates/admin.php(15): require('/home/aca/www/w...')
#68 /home/aca/www/webmanufaktur.test/wire/core/TemplateFile.php(327): require('/home/aca/www/w...')
#69 /home/aca/www/webmanufaktur.test/wire/core/Wire.php(414): ProcessWire\TemplateFile->___render()
#70 /home/aca/www/webmanufaktur.test/wire/core/WireHooks.php(951): ProcessWire\Wire->_callMethod()
#71 /home/aca/www/webmanufaktur.test/wire/core/Wire.php(485): ProcessWire\WireHooks->runHooks()
#72 /home/aca/www/webmanufaktur.test/wire/modules/PageRender.module(571): ProcessWire\Wire->__call()
#73 /home/aca/www/webmanufaktur.test/wire/core/Wire.php(417): ProcessWire\PageRender->___renderPage()
#74 /home/aca/www/webmanufaktur.test/wire/core/WireHooks.php(951): ProcessWire\Wire->_callMethod()
#75 /home/aca/www/webmanufaktur.test/wire/core/Wire.php(485): ProcessWire\WireHooks->runHooks()
#76 /home/aca/www/webmanufaktur.test/wire/core/WireHooks.php(1059): ProcessWire\Wire->__call()
#77 /home/aca/www/webmanufaktur.test/wire/core/Wire.php(485): ProcessWire\WireHooks->runHooks()
#78 /home/aca/www/webmanufaktur.test/wire/modules/Process/ProcessPageView.module(172): ProcessWire\Wire->__call()
#79 /home/aca/www/webmanufaktur.test/wire/modules/Process/ProcessPageView.module(114): ProcessWire\ProcessPageView->renderPage()
#80 /home/aca/www/webmanufaktur.test/wire/core/Wire.php(417): ProcessWire\ProcessPageView->___execute()
#81 /home/aca/www/webmanufaktur.test/wire/core/WireHooks.php(951): ProcessWire\Wire->_callMethod()
#82 /home/aca/www/webmanufaktur.test/wire/core/Wire.php(485): ProcessWire\WireHooks->runHooks()
#83 /home/aca/www/webmanufaktur.test/index.php(55): ProcessWire\Wire->__call()
#84 {main}

What did I do?

Within that instace I installed a second language for testing purposes, edited the homepage so that it has /de/ (default) and /en/ (second language), changed the Languages Support - Page Names settings to redirect to the default language path (/de/), created some pages, tested, felt fine with it.

Somewhere in-between I updated to the latest 3.0.190 dev and tested a bit more, did other stuff (frontend only, no API code or module dev), then deleted the second language and wanted to the change the homepage again... so here we are.

All other pages with (former) additional content in another language work fine, can be edited and whatsoever. The main difference seems to be that the homepage contains a repeater matrix field with content that's only available in english (second language I deleted now).

I always thought deleting languages is enough... maybe it isn't.

 

Someone any ideas?

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

×
×
  • Create New...