Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Call to a member function getMap() on null #61

Closed
juresrpcic opened this issue Dec 7, 2017 · 8 comments
Closed

Call to a member function getMap() on null #61

juresrpcic opened this issue Dec 7, 2017 · 8 comments

Comments

@juresrpcic
Copy link

On a clean Craft 3 RC1 install, I get an error that breaks Control Panel entirely after creating a Simple Map field with default settings.

Internal Server Error
Call to a member function getMap() on null

Any ideas?

@juresrpcic
Copy link
Author

Some additional information - I had a clean Craft 3 install but with other plugins installed when I got the error. I just tried a fresh install without any plugins + manually installed Simple Map with Composer and it worked without throwing that error.

@Tam
Copy link
Member

Tam commented Dec 7, 2017

That error suggests that the field type was being called in some way before the rest of the plugin had been initialised. It's most likely that one of the other plugins you had installed was causing this.

Could you let me know what other plugins you had installed?

@georgejr
Copy link

georgejr commented Dec 7, 2017

For me it caused:
Redirect plugin for Craft 3
Turned off, and everything seems to be fine:)

@juresrpcic
Copy link
Author

juresrpcic commented Dec 7, 2017

This is the list of plugins I have installed (doing some testing):

  • am-impact/amcommand github (3.1.0)
  • doublesecretagency/craft-cpcss github (2.0.0)
  • doublesecretagency/craft-cpjs github (2.0.0)
  • doublesecretagency/craft-cpbodyclasses github (2.0.0)
  • verbb/cp-nav:dev-craft-3 github (dev-craft-3)
  • superbig/craft3-collections github (2.0.0)
  • superbig/craft3-templateselect github (2.0.0)
  • superbig/craft3-mobiledetect github (1.0.1)
  • nystudio107/craft3-pathtools github (1.0.5)
  • nystudio107/craft3-minify github (1.2.5)
  • nystudio107/craft3-eagerbeaver github (1.0.0)
  • nystudio107/craft3-imageoptimize github (1.3.4)
  • nystudio107/craft3-instantanalytics github (1.0.0)
  • nystudio107/craft3-richvariables github (1.0.13)
  • barrelstrength/sprout-active github (2.0.1)
  • barrelstrength/sprout-notes github (2.0.4)
  • marionnewlevant/match-input github (2.0.0)
  • marionnewlevant/twig-perversion github (2.0.0)
  • marionnewlevant/agnostic-fetch github (2.0.0)
  • enupal/slider github (1.0.2)
  • luwes/craft3-inline github (1.0.0)
  • flipboxfactory/craft-postmark github (1.0.0-rc.1.1)
  • ether/simplemap github (3.1.1)

I tried to debug a bit more and turned all plugins off, I could create the Map field normally, then I turned them on one by one and couldn't replicate the original issue anymore. I'm sure it's another plugin causing this - if I find it (I'm not using Redirect like @georgejr ) I'll report it here.

@Tam
Copy link
Member

Tam commented Dec 7, 2017

Only a couple of other plugins then 😆

It would be worth checking your logs as well, as they will probably contain more information about the error. You can check your logs from within the Craft CP using Logs (shameless plug).

@juresrpcic
Copy link
Author

A few 💯 ...

I did look at the logs but nothing really jumps at me, here is the relevant part if you find it useful:

017-12-07 17:22:18 [127.0.0.1][-][d926fc96af6a766c2527abc7fa34ad3d][error][Error] Error: Call to a member function getMap() on null in C:\web\istjames\vendor\ether\simplemap\src\fields\MapField.php:521
Stack trace:
#0 C:\web\istjames\vendor\craftcms\cms\src\elements\db\ElementQuery.php(1439): ether\simplemap\fields\MapField->modifyElementsQuery(Object(craft\elements\db\UserQuery), NULL)
#1 C:\web\istjames\vendor\craftcms\cms\src\elements\db\ElementQuery.php(897): craft\elements\db\ElementQuery->_joinContentTable('craft\\elements\\...')
#2 C:\web\istjames\vendor\yiisoft\yii2\db\QueryBuilder.php(109): craft\elements\db\ElementQuery->prepare(Object(craft\db\mysql\QueryBuilder))
#3 C:\web\istjames\vendor\yiisoft\yii2\db\Query.php(129): yii\db\QueryBuilder->build(Object(craft\elements\db\UserQuery))
#4 C:\web\istjames\vendor\yiisoft\yii2\db\Query.php(259): yii\db\Query->createCommand(Object(craft\db\Connection))
#5 C:\web\istjames\vendor\craftcms\cms\src\db\Query.php(134): yii\db\Query->one(NULL)
#6 C:\web\istjames\vendor\craftcms\cms\src\elements\db\ElementQuery.php(1018): craft\db\Query->one(NULL)
#7 C:\web\istjames\vendor\craftcms\cms\src\elements\User.php(333): craft\elements\db\ElementQuery->one()
#8 C:\web\istjames\vendor\yiisoft\yii2\web\User.php(663): craft\elements\User::findIdentity('1')
#9 C:\web\istjames\vendor\craftcms\cms\src\web\User.php(375): yii\web\User->renewAuthStatus()
#10 C:\web\istjames\vendor\yiisoft\yii2\web\User.php(188): craft\web\User->renewAuthStatus()
#11 C:\web\istjames\vendor\yiisoft\yii2\web\User.php(333): yii\web\User->getIdentity()
#12 C:\web\istjames\vendor\am-impact\amcommand\src\CommandPalette.php(132): yii\web\User->getIsGuest()
#13 C:\web\istjames\vendor\am-impact\amcommand\src\CommandPalette.php(65): amimpact\commandpalette\CommandPalette->_registerPalette()
#14 C:\web\istjames\vendor\yiisoft\yii2\base\BaseObject.php(108): amimpact\commandpalette\CommandPalette->init()
#15 C:\web\istjames\vendor\yiisoft\yii2\base\Module.php(158): yii\base\BaseObject->__construct(Array)
#16 C:\web\istjames\vendor\craftcms\cms\src\base\Plugin.php(88): yii\base\Module->__construct('command-palette', Object(craft\web\Application), Array)
#17 [internal function]: craft\base\Plugin->__construct('command-palette', Object(craft\web\Application), Array)
#18 C:\web\istjames\vendor\yiisoft\yii2\di\Container.php(381): ReflectionClass->newInstanceArgs(Array)
#19 C:\web\istjames\vendor\yiisoft\yii2\di\Container.php(156): yii\di\Container->build('amimpact\\comman...', Array, Array)
#20 C:\web\istjames\vendor\yiisoft\yii2\BaseYii.php(349): yii\di\Container->get('amimpact\\comman...', Array, Array)
#21 C:\web\istjames\vendor\craftcms\cms\src\services\Plugins.php(777): yii\BaseYii::createObject(Array, Array)
#22 C:\web\istjames\vendor\craftcms\cms\src\services\Plugins.php(196): craft\services\Plugins->createPlugin('command-palette', Array)
#23 C:\web\istjames\vendor\craftcms\cms\src\base\ApplicationTrait.php(1167): craft\services\Plugins->loadPlugins()
#24 C:\web\istjames\vendor\craftcms\cms\src\web\Application.php(86): craft\web\Application->_init()
#25 C:\web\istjames\vendor\yiisoft\yii2\base\BaseObject.php(108): craft\web\Application->init()
#26 C:\web\istjames\vendor\yiisoft\yii2\base\Application.php(206): yii\base\BaseObject->__construct(Array)
#27 C:\web\istjames\vendor\craftcms\cms\src\web\Application.php(74): yii\base\Application->__construct(Array)
#28 [internal function]: craft\web\Application->__construct(Array)
#29 C:\web\istjames\vendor\yiisoft\yii2\di\Container.php(381): ReflectionClass->newInstanceArgs(Array)
#30 C:\web\istjames\vendor\yiisoft\yii2\di\Container.php(156): yii\di\Container->build('craft\\web\\Appli...', Array, Array)
#31 C:\web\istjames\vendor\yiisoft\yii2\BaseYii.php(349): yii\di\Container->get('craft\\web\\Appli...', Array, Array)
#32 C:\web\istjames\vendor\craftcms\cms\bootstrap\bootstrap.php(231): yii\BaseYii::createObject(Array)
#33 C:\web\istjames\vendor\craftcms\cms\bootstrap\web.php(37): require('C:\\web\\istjames...')
#34 C:\web\istjames\public\index.php(20): require('C:\\web\\istjames...')
#35 {main}

Nice log-o on the Logs plugin 👍

@juresrpcic
Copy link
Author

Hm, the log made me test again and I think it just might be Command Palette - am-impact/amcommand . If I just uninstall that one, I can create the Map field again. But funny enough, once I create the map field, I can re-enable Command Palette and then I can continue creating Map fields without errors. I'll submit this report to amcommand github as well...

@Tam
Copy link
Member

Tam commented Dec 18, 2017

Closing this, looks like it's fixed in Simple Map plugin breaks when Comand Palette enabled #33

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants