terminal42 / contao-node

Manage content centrally as nodes and reuse them everywhere.
MIT License
29 stars 8 forks source link

Removed patchwork/utf8 from NodesContentElement.php #35

Closed dennisbohn closed 2 years ago

dennisbohn commented 2 years ago

I got the following error in Contao 4.13 when I tried to open an article with a node element in backend.

image

strtoupper is not needed anymore because its done in CSS now. https://github.com/contao/contao/pull/3530

Tastaturberuf commented 2 years ago

Dont use patchwork/utf8 anymore. its abadoned. https://packagist.org/packages/patchwork/utf8

dennisbohn commented 2 years ago

That's only the case for Contao 4.13. So you either need to increase the contao/core-bundle requirement to ^4.13 - or require patchwork/utf8.

Sorry, I learned today that "merged into 4.x" doesnt affect all Contao 4 versions. ;)

fritzmg commented 2 years ago

Since Contao 4.4's support has ended anyway, I think that's fine ;)

dennisbohn commented 2 years ago

I tested "symfony/string" with 4.4 and it worked fine.

image

composer.json

{
    "name": "contao/managed-edition",
    "type": "project",
    "description": "Contao Open Source CMS",
    "license": "LGPL-3.0-or-later",
    "authors": [
        {
            "name": "Leo Feyer",
            "homepage": "https://github.com/leofeyer"
        }
    ],
    "require": {
        "php": "^5.6|^7.0",
        "contao/manager-bundle": "4.4.*",
        "terminal42/contao-node": "dev-patch-removed-patchwork-utf8"
    },
    "conflict": {
        "contao/core-bundle": "<4.4.8"
    },
    "config": {
        "component-dir": "assets"
    },
    "extra": {
        "branch-alias": {
            "dev-4.4": "4.4.x-dev"
        }
    },
    "scripts": {
        "post-install-cmd": [
            "Contao\\ManagerBundle\\Composer\\ScriptHandler::initializeApplication"
        ],
        "post-update-cmd": [
            "Contao\\ManagerBundle\\Composer\\ScriptHandler::initializeApplication"
        ]
    },
    "repositories": [
        {
            "url": "https://github.com/dennisbohn/contao-node.git",
            "type": "git"
        }
    ]
}
fritzmg commented 2 years ago

@aschempp can you merge and release this? As pointed out, requiring "symfony/string": "^5.4 || ^6.0" does not break Contao 4.4 compatibility.

dennisbohn commented 2 years ago

Can someone explain, why "symfony/string": "^5.4 || ^6.0" would be a problem with Contao 4.4? I created an instance with the following composer.json.

    "name": "contao/managed-edition",
    "type": "project",
    "description": "Contao Open Source CMS",
    "license": "LGPL-3.0-or-later",
    "authors": [
        {
            "name": "Leo Feyer",
            "homepage": "https://github.com/leofeyer"
        }
    ],
    "require": {
        "php": "^5.6|^7.0",
        "contao/manager-bundle": "4.4.*",
        "terminal42/contao-node": "dev-patch-removed-patchwork-utf8"
    },
    "minimum-stability": "dev",
    "prefer-stable" : true,
    "conflict": {
        "contao/core-bundle": "<4.4.8"
    },
    "config": {
        "component-dir": "assets"
    },
    "extra": {
        "branch-alias": {
            "dev-4.4": "4.4.x-dev"
        }
    },
    "scripts": {
        "post-install-cmd": [
            "Contao\\ManagerBundle\\Composer\\ScriptHandler::initializeApplication"
        ],
        "post-update-cmd": [
            "Contao\\ManagerBundle\\Composer\\ScriptHandler::initializeApplication"
        ]
    },
    "repositories": [
        {
            "url": "https://github.com/dennisbohn/contao-node.git",
            "type": "git"
        }
    ]
}

The node-bundle uses the following composer.json.

    "name": "terminal42/contao-node",
    "description": "Node bundle for Contao Open Source CMS",
    "keywords": ["contao", "node", "content"],
    "type": "contao-bundle",
    "license": "MIT",
    "authors": [{
        "name": "terminal42 gmbh",
        "homepage": "https://www.terminal42.ch"
    }],
    "funding": [{
        "type": "github",
        "url": "https://github.com/terminal42"
    }, {
        "type": "other",
        "url": "https://ko-fi.com/terminal42"
    }],
    "support": {
        "issues": "https://github.com/terminal42/contao-node/issues",
        "source": "https://github.com/terminal42/contao-node"
    },
    "require": {
        "php": ">=7.1",
        "contao/core-bundle": "^4.4",
        "codefog/contao-haste": "^4.21",
        "codefog/tags-bundle": "^3.0",
        "doctrine/dbal": "^2.13 || ^3.0",
        "symfony/string": "^5.4 || ^6.0"
    },
    "require-dev": {
        "terminal42/contao-geoip2-country": "^1.0",
        "contao/manager-plugin": "^2.0",
        "contao/easy-coding-standard": "^3.0"
    },
    "suggest": {
        "terminal42/contao-geoip2-country": "Protect nodes in Contao using MaxMind GeoIP2 database"
    },
    "conflict": {
        "contao/manager-plugin": "<2.0 || >=3.0"
    },
    "autoload": {
        "psr-4": {
            "Terminal42\\NodeBundle\\": "src/"
        }
    },
    "extra": {
        "contao-manager-plugin": "Terminal42\\NodeBundle\\ContaoManager\\Plugin"
    },
    "scripts": {
        "cs-fixer": [
            "vendor/bin/ecs check src/ --fix --ansi"
        ]
    }
}

You can test it here.

https://contao-test.office.bohn.media/contao User: k.jones Pass: kevinjones

I would prefer the use symfony/string because it is also be used in the Contao 4.13 core-bundle.

fritzmg commented 2 years ago

Can someone explain, why "symfony/string": "^5.4 || ^6.0" would be a problem with Contao 4.4?

It is in fact not a problem.

aschempp commented 2 years ago

I have now fixed in 9e4f9075c8f06c43b8aef27c2d8327072a31d14a