Support from Acquia helps fund testing for Drupal Acquia logo

Comments

remyyyyy created an issue. See original summary.

GuillaumeDuveau’s picture

Title: PHP 7.2 Function create_function() is deprecated » Function create_function() is deprecated in PHP >= 7.2
Status: Active » Needs review
Issue tags: -PHP 7.2, -PHP 7.0 (duplicate)
FileSize
324 bytes

It has been fixed in the library geshi/geshi on 11 Dec 2017: https://github.com/GeSHi/geshi-1.0/commit/ed9f49a7c7a195f6ed2bc864f5ce03...

But there has been no new release since 15 May 2017: https://github.com/GeSHi/geshi-1.0/releases

A workaround could be to use the version of the specific commit on which the issue was fixed. It's not great but who knows if and when geshi/geshi will have a new release.

See attached patch.

Caution: this patch can not be applied on the fly if you use Composer to manage your codebase (https://github.com/cweagans/composer-patches#patches-containing-modifica...).

mikedotexe’s picture

Interesting, thanks for making the patch. My composer.json file (based on drupal-composer/drupal-project)

uses this:
"drupal/geshifilter": "^1.2"

where your patch is looking for:
"geshi/geshi": "^1.0"

The command I used to install the GeSHi filter was at the top of this module page.

Curious that one starts with drupal/ and the other with geshi/
I'll admit I haven't had to do much Composer fiddling.

mikedotexe’s picture

Darn it, try as I might to not ask a dumb question, I now see that I have. You're discussing the composer.json in the module and I'm talking about my project. Please disregard and thanks for tracking this down @guix

yukare’s picture

I had something like this in the past, but some people need to use only stable modules, not dev. See https://www.drupal.org/project/geshifilter/issues/2906413 so we can use another aproach, let the user choose which version want to use.

Require the stable version as it is now by default, but allow and show how to install the dev version. There is an issue in geshi to create a new version (https://github.com/GeSHi/geshi-1.0/issues/106).

Grienauer’s picture

I gave an own "composer GeSHi hack" a try, to download GeSHi with commit… But I don't manage to get it working in the end. The "hack" was not "hacky" enough. Here the part of my composer. Maybe someone has another idea :)

    "geshi/hack": {
      "type": "package",
      "package": {
        "name": "geshi/geshi",
        "version": "1.1",
        "source": {
          "url": "https://github.com/GeSHi/geshi-1.0.git",
          "type": "git",
          "reference": "ed9f49a7c7a195f6ed2bc864f5ce03b990b5867d"
        }
      }
    }
jungle’s picture

Another workaround

put "geshi/geshi": "dev-master#ed9f49a7c7a195f6ed2bc864f5ce03b990b5867d as v1.0.9.0" into composer.json and run composer update

yukare’s picture

Status: Needs review » Closed (outdated)

The current geshi stable version 1.0.9.1 has this fix(for PHP 7.2), so this is not an issue anymore.