contao / core-bundle

[READ-ONLY] Contao Core Bundle
GNU Lesser General Public License v3.0
122 stars 57 forks source link

Warning: count(): Parameter must be an array... Countable in #1353

Closed kevbo24 closed 6 years ago

kevbo24 commented 6 years ago

hey together

I have the following Problem with contao.

It shows me the following on the top of the "page structure" and "article":

Warning: count(): Parameter must be an array or an object that implements Countable in C:\xampp\htdocs\muster\vendor\contao\core-bundle\src\Resources\contao\drivers\DC_Table.php on line 3548

under "article" i click on "new article" but then the arrow to go into the details for the article is missing under "page stucture" it is working till the "save-button" then it occurs following after click it (doesn's matter if just "save" or "save & close"):

Internal Server Error

Was ist das Problem?

Attempted to load class "Transliterator" from the global namespace. Did you forget a "use" statement?

Output composer show:

C:\xampp\htdocs\muster>composer show ausi/slug-generator v1.0.0 Slug Generator clue/stream-filter v1.4.0 A simple and modern approach to stream filtering in PHP composer/ca-bundle 1.1.0 Lets you find a path to the system CA bundle, and includes a fallba... contao-components/ace 1.2.9 ACE code editor integration for Contao Open Source CMS contao-components/chosen 1.1.10 Chosen integration for Contao Open Source CMS contao-components/colorbox 1.6.4 Colorbox integration for Contao Open Source CMS contao-components/colorpicker 1.4.0.2 Color picker integration for Contao Open Source CMS contao-components/compass 0.12.2.1 Compass integration for Contao Open Source CMS contao-components/contao 7.1.4 Contao Open Source CMS components contao-components/datepicker 2.2.0.4 Date picker integration for Contao Open Source CMS contao-components/dropzone 5.1.1 DropZone integration for Contao Open Source CMS contao-components/highlight 9.12.0 Highlight.js integration for Contao Open Source CMS contao-components/html5shiv 3.7.3 HTML5 Shiv integration for Contao Open Source CMS contao-components/installer 1.2.6 Contao components installer contao-components/jquery 1.12.4 jQuery integration for Contao Open Source CMS contao-components/jquery-ui 1.12.1.1 jQuery UI integration for Contao Open Source CMS contao-components/mediabox 1.5.4.2 Mediabox integration for Contao Open Source CMS contao-components/mediaelement 4.2.7 MediaElement.js integration for Contao Open Source CMS contao-components/mootools 1.6.0.5 MooTools integration for Contao Open Source CMS contao-components/respimage 1.4.2 Respimage.js integration for Contao Open Source CMS contao-components/simplemodal 2.0.7 SimpleModal integration for Contao Open Source CMS contao-components/swipe 2.0.6.2 A JavaScript touch slider with dot menu contao-components/tablesort 3.4.9 Contao Open Source CMS tablesort contao-components/tablesorter 2.0.5.6 jQuery tablesorter integration for Contao Open Source CMS contao-components/tinymce4 4.7.4 TinyMCE 4 integration for Contao Open Source CMS contao/calendar-bundle 4.5.3 Adds calendar functionality to Contao 4 contao/comments-bundle 4.5.3 Adds comments functionality to Contao 4 contao/core-bundle 4.5.3 Contao 4 core bundle contao/faq-bundle 4.5.3 Adds FAQ functionality to Contao 4 contao/image 0.3.5 Contao image library contao/imagine-svg 0.1.5 Contao Imagine SVG library contao/installation-bundle 4.5.3 Required to install and update Contao 4 contao/listing-bundle 4.5.3 Allows to list arbitrary data in the Contao 4 front end contao/manager-bundle 4.5.3 Contao 4 manager bundle contao/manager-plugin 2.2.0 Contao 4 manager plugin contao/news-bundle 4.5.3 Adds news functionality to Contao 4 contao/newsletter-bundle 4.5.3 Adds newsletter functionality to Contao 4 doctrine/annotations v1.6.0 Docblock Annotations Parser doctrine/cache v1.7.1 Caching library offering an object-oriented API for many cache back... doctrine/collections v1.5.0 Collections Abstraction library doctrine/common v2.8.1 Common Library for Doctrine projects doctrine/dbal v2.6.3 Database Abstraction Layer doctrine/doctrine-bundle 1.8.1 Symfony DoctrineBundle doctrine/doctrine-cache-bundle 1.3.2 Symfony Bundle for Doctrine Cache doctrine/inflector v1.3.0 Common String Manipulations with regard to casing and singular/plur... doctrine/lexer v1.0.1 Base library for a lexer that can be used in Top-Down, Recursive De... egulias/email-validator 2.1.3 A library for validating emails against several RFCs fig/link-util 1.0.0 Common utility implementations for HTTP links friendsofsymfony/http-cache 2.1.0 Tools to manage HTTP caching proxies with PHP friendsofsymfony/http-cache-bundle 2.1.2 Set path based HTTP cache headers and send invalidation requests to... guzzlehttp/guzzle 6.3.0 Guzzle is a PHP HTTP client library guzzlehttp/promises v1.3.1 Guzzle promises library guzzlehttp/psr7 1.4.2 PSR-7 message implementation that also provides common utility methods imagine/imagine v0.7.1 Image processing for PHP 5.3 jdorn/sql-formatter v1.2.17 a PHP SQL highlighting library knplabs/knp-menu 2.3.0 An object oriented menu library knplabs/knp-menu-bundle v2.2.1 This bundle provides an integration of the KnpMenu library knplabs/knp-time-bundle 1.8.0 Knplabs time bundle makes your dates look sensible and descriptive leafo/scssphp v0.7.4 scssphp is a compiler for SCSS written in PHP. league/uri 5.2.0 URI manipulation library league/uri-components 1.6.0 URI components manipulation library league/uri-hostname-parser 1.0.4 ICANN base hostname parsing implemented in PHP. league/uri-interfaces 1.0.0 Common interface for URI representation league/uri-manipulations 1.3.0 URI manipulation library league/uri-parser 1.3.0 userland URI parser RFC 3986 compliant league/uri-schemes 1.1.1 URI manipulation library lexik/maintenance-bundle v2.1.3 This bundle allows you to place your website in maintenance mode by... matthiasmullie/minify 1.3.58 CSS & JavaScript minifier, in PHP. Removes whitespace, strips comme... matthiasmullie/path-converter 1.1.0 Relative path converter michelf/php-markdown 1.8.0 PHP Markdown monolog/monolog 1.23.0 Sends your logs to files, sockets, inboxes, databases and various w... nelmio/cors-bundle 1.5.4 Adds CORS (Cross-Origin Resource Sharing) headers support in your S... nelmio/security-bundle 2.4.0 Extra security-related features for Symfony: signed/encrypted cooki... ocramius/package-versions 1.2.0 Composer plugin that provides efficient querying for installed pack... oyejorge/less.php v1.7.0.14 PHP port of the Javascript version of LESS http://lesscss.org (Orig... paragonie/random_compat v2.0.11 PHP 5.x polyfill for random_bytes() and randomint() from PHP 7 patchwork/utf8 v1.3.1 Portable and performant UTF-8, Unicode and Grapheme Clusters for PHP php-http/client-common 1.7.0 Common HTTP Client implementations and tools for HTTPlug php-http/discovery 1.3.0 Finds installed HTTPlug implementations and PSR-7 message factories php-http/guzzle6-adapter v1.1.1 Guzzle 6 HTTP Adapter php-http/httplug v1.1.0 HTTPlug, the HTTP client abstraction for PHP php-http/message 1.6.0 HTTP Message related tools php-http/message-factory v1.0.2 Factory interfaces for PSR-7 HTTP Message php-http/promise v1.0.0 Promise used for asynchronous HTTP requests phpspec/php-diff v1.1.0 A comprehensive library for generating differences between two hash... phpunit/php-token-stream 1.4.12 Wrapper around PHP's tokenizer extension. psr/cache 1.0.1 Common interface for caching libraries psr/container 1.0.0 Common Container Interface (PHP FIG PSR-11) psr/http-message 1.0.1 Common interface for HTTP messages psr/link 1.0.0 Common interfaces for HTTP links psr/log 1.0.2 Common interface for logging libraries psr/simple-cache 1.0.0 Common interfaces for simple caching sensio/distribution-bundle v5.0.21 Base bundle for Symfony Distributions sensio/framework-extra-bundle v5.1.4 This bundle provides a way to configure your controllers with annot... sensiolabs/ansi-to-html v1.1.3 A library to convert a text with ANSI codes to HTML sensiolabs/security-checker v4.1.7 A security checker for your composer.lock simplepie/simplepie 1.5.1 A simple Atom/RSS parsing library for PHP swiftmailer/swiftmailer v6.0.2 Swiftmailer, free feature-rich PHP mailer symfony/monolog-bundle v3.1.2 Symfony MonologBundle symfony/polyfill-apcu v1.6.0 Symfony polyfill backporting apcu* functions to lower PHP versions symfony/polyfill-intl-icu v1.6.0 Symfony polyfill for intl's ICU-related data and classes symfony/polyfill-mbstring v1.6.0 Symfony polyfill for the Mbstring extension symfony/polyfill-php56 v1.6.0 Symfony polyfill backporting some PHP 5.6+ features to lower PHP ve... symfony/polyfill-php70 v1.6.0 Symfony polyfill backporting some PHP 7.0+ features to lower PHP ve... symfony/polyfill-util v1.6.0 Symfony utilities for portability of PHP codes symfony/swiftmailer-bundle v3.1.6 Symfony SwiftmailerBundle symfony/symfony v3.4.3 The Symfony PHP framework tecnickcom/tcpdf 6.2.13 TCPDF is a PHP class for generating PDF documents and barcodes. terminal42/header-replay-bundle 1.4.1 Send preflight requests for user context headers and replay them fo... true/punycode v2.1.1 A Bootstring encoding of Unicode for Internationalized Domain Names... twig/twig v2.4.4 Twig, the flexible, fast, and secure template language for PHP ua-parser/uap-php v3.5.0 A multi-language port of Browserscope's user agent parser. webmozart/assert 1.2.0 Assertions to validate method input/output with nice error messages. webmozart/path-util 2.3.0 A robust cross-platform utility for normalizing, comparing and modi...

I have/use: windows 10, apache with xampp (phpmyadmin), contao 4.5.3

phpmyadmin database server:

Server: 127.0.0.1 via TCP/IP Server-Typ: MariaDB Server-Version: 10.1.30-MariaDB - mariadb.org binary distribution Protokoll-Version: 10 Benutzer: root@localhost Server-Zeichensatz: UTF-8 Unicode (utf8)

webserver:

Apache/2.4.29 (Win32) OpenSSL/1.1.0g PHP/7.2.1

phpmyadmin:

Versionsinformationen: 4.7.7 (auf dem neuesten Stand)

xchs commented 6 years ago

I can confirm that as well. I also get warnings in my installation when I open the Articles or Page structure back end modules.

Contao 4.5.3, PHP 7.2.1

kevbo24 commented 6 years ago

Is there a way to save a new page or article? Contao is useless for me at the moment

fritzmg commented 6 years ago

I think your only option right now is to switch back to PHP 7.1.

leofeyer commented 6 years ago

@xchs Does the issue occur in Contao 4.5 only? I couldn't reproduce it in Contao 4.4.

xchs commented 6 years ago

Does the issue occur in Contao 4.5 only?

It seems so. I cannot reproduce it in Contao 4.4 either.

tefracky commented 6 years ago

I'm using zad_sendnews and added following 3 lines for an automatic teaser:

// add default auto-teaser at first full stop or 80 chars $this->import('String'); $pos = max(300, (strpos($this->text, '.')+1)); $this->news['teaser'] = $this->String->substr($this->text, $pos, ($pos == 300));

It occurs following problem: [2018-02-09 23:06:02] app.CRITICAL: An exception occurred. {"exception":"[object] (Symfony\Component\Debug\Exception\ClassNotFoundException(code: 0): Attempted to load class \"String\" from the global namespace.\nDid you forget a \"use\" statement for \"PHPExcel_Shared_String\"? at /var/www/vhosts/hosting104991.af9be.netcup.net/httpdocs/contao4/vendor/contao/core-bundle/src/Resources/contao/library/Contao/System.php:175)"} []

I am using Contao 4.5, could it be the same problem?

xchs commented 6 years ago

Nope.

leofeyer commented 6 years ago

@xchs Now I cannot reproduce it in Contao 4.5 anymore, either. How exactly did you do it?

xchs commented 6 years ago

I can reproduce it in Contao 4.5.3 as well as Contao 4.5.4.

Steps to reproduce:

site structure contao open source cms

emters commented 6 years ago

The same error is happening to me when I go to Articles or Site Structure with PHP 7.2 and Contao 4.4.14

xchs commented 6 years ago

I just tested it again with Contao 4.4.14 and PHP 7.2.0: No problem so far. Everything seems to be working properly.

emters commented 6 years ago

I managed to make it work by adding a Root Page directly to the database. But everytime I'm setting up a fresh install of Contao, the error comes back. contao-error

xchs commented 6 years ago

Ah, you are right. The dev mode shows the warning.

leofeyer commented 6 years ago

Fixed in 3695d4f7d934bb51f26ee2cf7638082d94ce343e.

kevbo24 commented 6 years ago

I can still not save a new site...

Internal Server Error
Was ist das Problem?

Attempted to load class "Transliterator" from the global namespace. Did you forget a "use" statement?
Toflar commented 6 years ago

That's not an issue of Contao, update your dependencies please.

kevbo24 commented 6 years ago

Sorry i don't know what you mean with dependencies?

phpmyadmin: Versionsinformationen: 4.7.8 (auf dem neuesten Stand)

Apache/2.4.29 (Win32) OpenSSL/1.1.0g PHP/7.2.1 
Server-Version: 10.1.30-MariaDB - mariadb.org binary distribution 
Contao: 4.5.4
Xirdion commented 6 years ago

The dependencies are the packages that are installed via composer. So when you run composer the first time (Contao-Manager / command line) you are installing the packages with a specific version. With the Contao-Manager or composer update on the command line you can look for updates for these dependencies and install them.

xchs commented 6 years ago

Fixed in 3695d4f.

👍 Works for me.

kevbo24 commented 6 years ago

Thx works fine now!

xchs commented 6 years ago

@leofeyer Did you merge https://github.com/contao/core-bundle/commit/3695d4f7d934bb51f26ee2cf7638082d94ce343e into the 4.5 branch as well? The issue also affects Contao 4.5.

leofeyer commented 6 years ago

It seems that the commit has not been merged into contao/core-bundle at all:

Eventually added in 34056c8d62e503520f808a3745d2662d8a9a2834.

jedoCodes commented 6 years ago

Fixed in 3695d4f. 👍 Works for me.

gleiches problem andere Zeile:

Uncaught PHP Exception Symfony\Component\Debug\Exception\ContextErrorException: "Warning: count(): Parameter must be an array or an object that implements Countable" at /Volumes/Macintosh HOME/htdocs/contao_development/vendor/contao/core-bundle/src/Resources/contao/drivers/DC_Table.php line 4887

leofeyer commented 6 years ago

@jedoStyle Wie genau lässt sich das reproduzieren? Bei mir ist $orderBy immer ein Array.

jedoCodes commented 6 years ago

ich mach nichts anderes als in der tabelle (dca) den Sorting modus zu setzen.

Zeile 3548 war bei mir modus 5 Zeile 4887 war bai mir modus 3

Contao V 4.5.6 und PHP 7.2.1 (installation local MacOS 10.13.3 & Mamp Pro 4.4.1)

leofeyer commented 6 years ago

Ok, das kann ich wie gesagt nicht reproduzieren.