Kuestenschmiede / MapsBundle

The interactive maps brick of the Contao GIS-kit con4gis.
https://maps.con4gis.org
GNU Lesser General Public License v3.0
7 stars 6 forks source link

Contao 4.9, PHP 7.4 with con4gis/maps 8.0/8.2: 'Undefined class constant 'MODE_TREE'' Error #84

Closed Webstylerin closed 3 months ago

Webstylerin commented 1 year ago

Hello, I am having issues with a Contao 4.9 website that uses con4gis/maps. I am trying to move the site to another server, but I can't get it installed there.

The initial installation via Contao Manager, PHP 7.4, and con4gis/maps 8.0 went through. However, the Install-Tool broke after entering the database details with the following error:

[2023-08-24 13:25:44] console.CRITICAL: Error thrown while running command "cache:warmup --env=prod --no-ansi". Message: "Undefined class constant 'MODE_TREE'" {"exception":"[object] (Error(code: 0): Undefined class constant 'MODE_TREE' at /var/www/vhosts/…/var/cache/prod/contao/dca/tl_c4g_maps.php:9)","command":"cache:warmup --env=prod --no-ansi","message":"Undefined class constant 'MODE_TREE'"} []

When I try to update the packages via the Manager, it breaks with the following message:

In tl_c4g_maps.php line 9: Undefined class constant 'MODE_TREE'

I then removed the extension, everything goes through, and then installed it in the latest version (8.2). The error remains.

Does anyone know what I can do to get the extension working again?

Best regards, Nicole

Webstylerin commented 1 year ago

The issue keeps recurring on various pages. Currently, I again have a Contao 4.9 site that shows the same error with PHP 7.4. When switching to PHP 8.2, this error changes as follows:

In ScriptHandler.php line 98:

  An error occurred while executing the "cache:warmup" command: 08:44:36 CRIT  
  ICAL  [console] Error thrown while running command "cache:warmup --env=prod  
   --no-ansi". Message: "Class "Contao\ArrayUtil" not found" ["exception" =>   
  Error { …},"command" => "cache:warmup --env=prod --no-ansi","message" => "C  
  lass "Contao\ArrayUtil" not found"]                                          

  In config.php line 31:                                                       

    Attempted to load class "ArrayUtil" from namespace "Contao".               

    Did you forget a "use" statement for "Mvo\ContaoGroupWidget\Util\ArrayUti  
  l"                                                                           
    ?

Contao Manager version is 1.7.0.

Best regards, Nicole

coastforge-mei commented 1 year ago

Hi Nicole,

unfortunately, the error does not occur with us. Nevertheless, I have removed the constant from your first message. Maybe that solves your problem. Perhaps the error only occurs in conjunction with other extensions?

Please try con4gis/maps 8.2.11

Best regards, Matthias

Webstylerin commented 12 months ago

Hi Matthias,

Thank you for the change. I have now tested the first installation. The extension can be installed again, however, the map does not appear in the frontend. I'm getting the following error:

[ServiceNotFoundException](https://domain.tld/con4gis/baseLayerService/1/de#trace-box-1) HTTP 500 Internal Server Error You have requested a non-existent service "contao.insert_tag.parser".

In the backend, when opening the map profile and the map structures, I also get server errors:

Attempted to call an undefined method named "getDefaultTokenValue" of class "Contao\CoreBundle\Csrf\ContaoCsrfTokenManager".

Here's the translation:

Can you proceed with that, or do you need more information from me?

Best regards, Nicole