I get following error when i select the Manage display tab

Fatal error: Declaration of Drupal\geofield\Plugin\Field\FieldFormatter\GeofieldDefaultFormatter::viewElements() must be compatible with Drupal\Core\Field\FormatterInterface::viewElements(Drupal\Core\Field\FieldItemListInterface $items, $langcode) in D:\WAMPDrupal8localhost\www\Project1\modules\geofield\src\Plugin\Field\FieldFormatter\GeofieldDefaultFormatter.php on line 84
Call Stack
# Time Memory Function Location
1 0.0002 240128 {main}( ) ..\index.php:0
2 0.0019 610360 Drupal\Core\DrupalKernel->handle( ) ..\index.php:19
3 0.0204 1730464 Stack\StackedHttpKernel->handle( ) ..\DrupalKernel.php:637
4 0.0204 1730576 Drupal\Core\StackMiddleware\NegotiationMiddleware->handle( ) ..\StackedHttpKernel.php:23
5 0.0205 1731232 Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle( ) ..\NegotiationMiddleware.php:55
6 0.0205 1731672 Drupal\ban\BanMiddleware->handle( ) ..\ReverseProxyMiddleware.php:51
7 0.0208 1732624 Drupal\page_cache\StackMiddleware\PageCache->handle( ) ..\BanMiddleware.php:55
8 0.0211 1741304 Drupal\page_cache\StackMiddleware\PageCache->pass( ) ..\PageCache.php:82
9 0.0212 1741384 Drupal\Core\StackMiddleware\KernelPreHandle->handle( ) ..\PageCache.php:103
10 0.0331 2250320 Drupal\Core\StackMiddleware\Session->handle( ) ..\KernelPreHandle.php:53
11 0.0378 2406920 Symfony\Component\HttpKernel\HttpKernel->handle( ) ..\Session.php:62
12 0.0378 2407848 Symfony\Component\HttpKernel\HttpKernel->handleRaw( ) ..\HttpKernel.php:62
13 0.1242 5905112 call_user_func_array:{D:\WAMPDrupal8localhost\www\Project1\vendor\symfony\http-kernel\HttpKernel.php:139} ( ) ..\HttpKernel.php:139
14 0.1242 5905304 Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}( ) ..\HttpKernel.php:139
15 0.1242 5905560 Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext( ) ..\EarlyRenderingControllerWrapperSubscriber.php:102
16 0.1244 5917880 Drupal\Core\Render\Renderer->executeInRenderContext( ) ..\EarlyRenderingControllerWrapperSubscriber.php:129
17 0.1244 5918368 Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}( ) ..\Renderer.php:577
18 0.1244 5918416 call_user_func_array:{D:\WAMPDrupal8localhost\www\Project1\core\lib\Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber.php:128} ( ) ..\EarlyRenderingControllerWrapperSubscriber.php:128
19 0.1244 5919088 Drupal\Core\Controller\FormController->getContentResult( ) ..\EarlyRenderingControllerWrapperSubscriber.php:128
20 0.2867 7812080 Drupal\Core\Form\FormBuilder->buildForm( ) ..\FormController.php:79
21 0.2870 7813336 Drupal\Core\Form\FormBuilder->retrieveForm( ) ..\FormBuilder.php:276
22 0.2877 7822984 call_user_func_array:{D:\WAMPDrupal8localhost\www\Project1\core\lib\Drupal\Core\Form\FormBuilder.php:517} ( ) ..\FormBuilder.php:517
23 0.2877 7823592 Drupal\Core\Entity\EntityForm->buildForm( ) ..\FormBuilder.php:517
24 0.2887 7826888 Drupal\field_ui\Form\EntityDisplayFormBase->form( ) ..\EntityForm.php:120
25 0.3042 8533904 Drupal\field_ui\Form\EntityViewDisplayEditForm->buildFieldRow( ) ..\EntityDisplayFormBase.php:187
26 0.3042 8533904 Drupal\field_ui\Form\EntityDisplayFormBase->buildFieldRow( ) ..\EntityViewDisplayEditForm.php:41
27 0.3042 8533952 Drupal\field_ui\Form\EntityDisplayFormBase->getApplicablePluginOptions( ) ..\EntityDisplayFormBase.php:276
28 0.3042 8534480 Drupal\Component\Plugin\Factory\DefaultFactory::getPluginClass( ) ..\EntityDisplayFormBase.php:751
29 0.3042 8534880 class_exists ( ) ..\DefaultFactory.php:101
30 0.3042 8535336 spl_autoload_call ( ) ..\DefaultFactory.php:101
31 0.3042 8535424 Composer\Autoload\ClassLoader->loadClass( ) ..\DefaultFactory.php:0
32 0.3047 8535608 Composer\Autoload\includeFile( ) ..\ClassLoader.php:301

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

VBN created an issue. See original summary.

VBN’s picture

I did a retry on a fresh v8.0.2 and installed 3 additional modules:
- Admin Toolbar
- GeoPHP
- Geofield

When i add a geofield in the field manager of a content type the same error returns:
Drupal\geofield\Plugin\Field\FieldFormatter\GeofieldDefaultFormatter::viewElements() must be compatible with Drupal\Core\Field\FormatterInterface::viewElements(Drupal\Core\Field\FieldItemListInterface $items, $langcode) in [mysite]\modules\geofield\src\Plugin\Field\FieldFormatter\GeofieldDefaultFormatter.php on line 84.

Any ideas how to solve this?

heykarthikwithu’s picture

Version: 8.x-1.0-alpha1 » 8.x-1.x-dev

was able to reproduce the bug.
Fatal error: Call to undefined method Drupal\geophp\GeoPHPWrapper::load() in /var/www/html/d8/modules/geofield/src/Plugin/Field/FieldType/GeofieldItem.php on line 206

heykarthikwithu’s picture

Was able reproduce bug with geofield 8.x-1.x-dev and geophp 8.x-1.0-beta1.

But was not able to reproduce the same bug with geofield 8.x-1.x and geophp 8.x-1.x.

So this issue won't needs any fix.

@VBN you can close the issue once you check with the above dev versions.

VBN’s picture

I'm sorry, I forgot to mention the versions i installed.
- geophp 8.x-1.0-beta1
- geofield 8.x-1.0-alpha1

Maybe a strange question, but where can i find geophp 8.x-1.x?
Releases only mention geophp 8.x-1.0-beta1 and geophp 8.x-1.x-dev...

heykarthikwithu’s picture

VBN’s picture

Ohw, that's confusing that the official Drupal version(s) are not working but the git versions do.
I'm just eager to play with the new d8 version , but i'm hitting one wall after another.
Just reporting errors and things i encounter from my non-expertise point of view.
I just follow what many would do by using the drupal interface, no drush.
Maybe better wait another few months so more modules are stable and child diseases are gone...

Thank you very much nevertheless.

tikaszvince’s picture

Hi

I attached a patch. It can apply on 8.x-1.0-alpha1. It fixed three Drupal 8.0.2 interface compatibility errors. One of them is the one reported by this issue.

tikaszvince’s picture

Version: 8.x-1.x-dev » 8.x-1.0-alpha1
Status: Active » Needs review
VBN’s picture

Applied patch from #8 on version geofield-8.x-1.0-alpha1.tar
Patch confirmed.
Looks like it's working with Geophp 8.x-1.0-beta1

No errors at this point.
I'll dig a bit deeper to see if more errors pop up.

Peter van den Heuvel’s picture

This patch worked for me (#8) on clean install Drupal 8.0.2 with 8.x-1.0-alpha1.

kentr’s picture

Status: Needs review » Reviewed & tested by the community

Patch in #8 fixed the incompatible interface error for me on 8.x-1.0-alpha1.

marcoscano’s picture

+1 for patch #8

Drupal 8.0.3 with geofield 8.x-1.0-alpha1 and geophp 8.x-1.0-beta1.
Vanilla install, WSOD after trying to create a geofield field.
Field is created correctly after applying the patch in #8

iampuma’s picture

Patch is working thanks. The Styled Google Map module depends on Geofield, so please commit to stable.

TechnoTim2010’s picture

I can confirm that the patch in #8 works with geofield 8.x-1.0-alpha1 on Drupal 8.1.0

Cheers,

  • plopesc committed f14d620 on 8.x-1.x
    Issue #2642550 by tikaszvince, VBN, Peter van den Heuvel, marcoscano:...
plopesc’s picture

Patch applied to -dev version.

Thanks

plopesc’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.