Drupal 11 compatibility fixes for fontawesome

Created on 4 August 2024, 6 months ago

Drupal 11 compatibility fixes based on CI

Feature request
Status

Active

Version

2.0

Component

Code

Created by

🇦🇺Australia VladimirAus Brisbane, Australia

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @VladimirAus
  • Merge request !38Drupal 11 compatibility → (Merged) created by VladimirAus
  • 🇦🇺Australia VladimirAus Brisbane, Australia

    VladimirAus changed the visibility of the branch 8.x-2.x to hidden.

  • Pipeline finished with Failed
    6 months ago
    Total: 161s
    #243315
  • Status changed to Needs review 6 months ago
  • 🇦🇺Australia VladimirAus Brisbane, Australia

    To test Drupal 11, add the following to composer.json repositories

      "repositories": [
        {
          "type": "vcs",
          "url": "https://git.drupalcode.org/issue/fontawesome-3465765.git"
        },
    ...
      ],
    

    and then run

    composer require drupal/fontawesome:dev-3465748-drupal-11-compatibility
    
  • Pipeline finished with Failed
    6 months ago
    Total: 175s
    #243330
  • 🇺🇸United States mariohernandez Los Angeles

    Instruction in #4 did not work for me on a new vanilla Drupal 11 installation. I get the following error:

    Your requirements could not be resolved to an installable set of packages.
    
      Problem 1
        - Root composer.json requires drupal/fontawesome dev-3465765-drupal-11-compatibility, it is satisfiable by drupal/fontawesome[dev-3465765-drupal-11-compatibility] from vcs repo (git https://git.drupalcode.org/issue/fontawesome-3465765.git) but drupal/fontawesome[dev-1.x, dev-2.x, 1.1.0, ..., 1.x-dev (alias of dev-1.x), 2.0.0-alpha1, ..., 2.x-dev (alias of dev-2.x)] from composer repo (https://packages.drupal.org/8) has higher repository priority. The packages from the higher priority repository do not match your constraint and are therefore not installable. That repository is canonical so the lower priority repo's packages are not installable. See https://getcomposer.org/repoprio for details and assistance.
  • 🇦🇺Australia VladimirAus Brisbane, Australia

    @mariohernandez you need to change minimum-stability in your composer

      "minimum-stability": "dev",
    
  • 🇺🇸United States mariohernandez Los Angeles

    Yes, that was it. Thanks, @vladimiraus. I was able to install and enable the fontawesome module in Drupal 11. However, when I go to FontAwesome's settings page (admin/config/content/fontawesome), I get the following error:

    ArgumentCountError: Too few arguments to function Drupal\Core\Form\ConfigFormBase::__construct(), 1 passed in /var/www/html/web/modules/contrib/fontawesome/src/Form/SettingsForm.php on line 30 and exactly 2 expected in Drupal\Core\Form\ConfigFormBase->__construct() (line 43 of core/lib/Drupal/Core/Form/ConfigFormBase.php).
    Drupal\fontawesome\Form\SettingsForm->__construct() (Line: 39)
    Drupal\fontawesome\Form\SettingsForm::create() (Line: 36)
    Drupal\Core\DependencyInjection\ClassResolver->getInstanceFromDefinition() (Line: 48)
    Drupal\Core\Controller\HtmlFormController->getFormObject() (Line: 58)
    Drupal\Core\Controller\FormController->getContentResult()
    call_user_func_array() (Line: 123)
    Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 593)
    Drupal\Core\Render\Renderer->executeInRenderContext() (Line: 121)
    Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext() (Line: 97)
    Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 183)
    Symfony\Component\HttpKernel\HttpKernel->handleRaw() (Line: 76)
    Symfony\Component\HttpKernel\HttpKernel->handle() (Line: 53)
    Drupal\Core\StackMiddleware\Session->handle() (Line: 48)
    Drupal\Core\StackMiddleware\KernelPreHandle->handle() (Line: 28)
    Drupal\Core\StackMiddleware\ContentLength->handle() (Line: 32)
    Drupal\big_pipe\StackMiddleware\ContentLength->handle() (Line: 106)
    Drupal\page_cache\StackMiddleware\PageCache->pass() (Line: 85)
    Drupal\page_cache\StackMiddleware\PageCache->handle() (Line: 48)
    Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle() (Line: 51)
    Drupal\Core\StackMiddleware\NegotiationMiddleware->handle() (Line: 36)
    Drupal\Core\StackMiddleware\AjaxPageState->handle() (Line: 51)
    Drupal\Core\StackMiddleware\StackedHttpKernel->handle() (Line: 709)
    Drupal\Core\DrupalKernel->handle() (Line: 19)
    
  • Status changed to Needs work 5 months ago
  • 🇦🇺Australia VladimirAus Brisbane, Australia
  • Status changed to Needs review 5 months ago
  • 🇦🇺Australia VladimirAus Brisbane, Australia
    • Removed CKEditor 4 compatibility

    See 📌 CKEditor 5 compatibility Needs review for CKEditor5 compatibility.

  • 🇦🇺Australia VladimirAus Brisbane, Australia

    @mariohernandez form shouldn't crash anymore.

  • Pipeline finished with Failed
    5 months ago
    Total: 183s
    #266135
  • 🇺🇸United States mariohernandez Los Angeles

    Thank you, @vladimiraus. I successfully tested changing settings options for fontawesome.

  • 🇫🇷France Kgaut

    working for me, thanks

  • Status changed to RTBC 5 months ago
  • 🇦🇺Australia VladimirAus Brisbane, Australia
  • 🇦🇺Australia jannakha Brisbane!

    RTBC +1

  • 🇨🇷Costa Rica yuvania

    RTBC +2

  • 🇳🇱Netherlands basvredeling Amsterdam

    src/Plugin/Field/FieldType/FontAwesomeIcon.php:17 causes a D11 deprecation warning:

    Using a translatable string as a category for field type is deprecated in drupal:10.2.0 and is removed from drupal:11.0.0. See [#3375748]

    It probably needs to refer to a new "icons" field type category supplied by fontawesome.field_type_categories.yml config.

  • Status changed to Needs work 4 months ago
  • 🇦🇺Australia VladimirAus Brisbane, Australia

    Thanks @basvredeling. Moving to needs work

  • I've installed fontawesome and menu icons on Drupal 11.0.4

    The icons appear in menus using svg, but in views and content it looks like the display falls back to the

    I'm also seeing some question / exclam marks when lists of icons for selection are shown when editing the content.

  • 🇺🇸United States graytoby

    When creating new fields for any content type, I get this error

    AssertionError: "Icons" must be defined in MODULE_NAME.field_type_categories.yml in assert() (line 183 of /app/web/core/lib/Drupal/Core/Field/FieldTypePluginManager.php).

    Backtrace:

    #0 /app/web/core/lib/Drupal/Core/Field/FieldTypePluginManager.php(183): assert(false, '"Icons" must be...')
    #1 /app/web/core/modules/field_ui/src/Form/FieldStorageAddForm.php(131): Drupal\Core\Field\FieldTypePluginManager->getGroupedDefinitions(Array, 'label', 'id')
    #2 /app/web/core/modules/field_ui/src/Form/FieldStorageAddForm.php(80): Drupal\field_ui\Form\FieldStorageAddForm->processFieldDefinitions(Object(Drupal\Core\Form\FormState))
    #3 [internal function]: Drupal\field_ui\Form\FieldStorageAddForm->buildForm(Array, Object(Drupal\Core\Form\FormState), 'node', 'services')
    #4 /app/web/core/lib/Drupal/Core/Form/FormBuilder.php(528): call_user_func_array(Array, Array)
    #5 /app/web/core/lib/Drupal/Core/Form/FormBuilder.php(279): Drupal\Core\Form\FormBuilder->retrieveForm('field_ui_field_...', Object(Drupal\Core\Form\FormState))
    #6 /app/web/core/lib/Drupal/Core/Controller/FormController.php(73): Drupal\Core\Form\FormBuilder->buildForm(Object(Drupal\field_ui\Form\FieldStorageAddForm), Object(Drupal\Core\Form\FormState))
    #7 [internal function]: Drupal\Core\Controller\FormController->getContentResult(Object(Symfony\Component\HttpFoundation\Request), Object(Drupal\Core\Routing\RouteMatch))
    #8 /app/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array(Array, Array)
    #9 /app/web/core/lib/Drupal/Core/Render/Renderer.php(593): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
    #10 /app/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(121): Drupal\Core\Render\Renderer->executeInRenderContext(Object(Drupal\Core\Render\RenderContext), Object(Closure))
    #11 /app/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(97): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array)
    #12 /app/vendor/symfony/http-kernel/HttpKernel.php(183): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
    #13 /app/vendor/symfony/http-kernel/HttpKernel.php(76): Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request), 1)
    #14 /app/web/core/lib/Drupal/Core/StackMiddleware/Session.php(53): Symfony\Component\HttpKernel\HttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
    #15 /app/web/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(48): Drupal\Core\StackMiddleware\Session->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
    #16 /app/web/core/lib/Drupal/Core/StackMiddleware/ContentLength.php(28): Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
    #17 /app/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(106): Drupal\Core\StackMiddleware\ContentLength->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
    #18 /app/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(85): Drupal\page_cache\StackMiddleware\PageCache->pass(Object(Symfony\Component\HttpFoundation\Request), 1, true)
    #19 /app/web/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(48): Drupal\page_cache\StackMiddleware\PageCache->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
    #20 /app/web/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(51): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
    #21 /app/web/core/lib/Drupal/Core/StackMiddleware/AjaxPageState.php(36): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
    #22 /app/web/core/lib/Drupal/Core/StackMiddleware/StackedHttpKernel.php(51): Drupal\Core\StackMiddleware\AjaxPageState->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
    #23 /app/web/core/lib/Drupal/Core/DrupalKernel.php(709): Drupal\Core\StackMiddleware\StackedHttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
    #24 /app/web/index.php(19): Drupal\Core\DrupalKernel->handle(Object(Symfony\Component\HttpFoundation\Request))
    #25 {main}
  • 🇳🇱Netherlands basvredeling Amsterdam

    Please add this field type categories fix to the MR.

  • First commit to issue fork.
  • Pipeline finished with Canceled
    3 months ago
    Total: 145s
    #313150
  • Pipeline finished with Failed
    3 months ago
    Total: 184s
    #313151
  • 🇦🇺Australia elc

    Should the phpstan (Using \Drupal calls in classes) be fixed here, or in their own issue?

    Unit tests pass. phpcs, eslint and cspell all have warnings but they aren't stopping this issue.

    Upgrade Status job should be removed for now, as it has ticked over to testing Drupal 12 which this module does not currently support, and for which there is no core release to test will anyway.

  • Pipeline finished with Failed
    3 months ago
    Total: 156s
    #313239
  • Pipeline finished with Failed
    3 months ago
    Total: 151s
    #313982
  • 🇦🇺Australia elc

    The phpstan issues were added in this issue so I've fixed it in this issue.

    Remaining task is to deal with deprecated method encountered in phpstan (next minor).

     ------ ----------------------------------------------------------------- 
      Line   src/Form/SettingsForm.php                                        
     ------ ----------------------------------------------------------------- 
      304    Call to deprecated method clearCachedDefinitions() of interface  
             Drupal\Core\Asset\LibraryDiscoveryInterface:                     
             in drupal:11.1.0 and is removed from drupal:12.0.0. Use          
             LibraryDiscoveryCollector::clear() instead.                      
     ------ -----------------------------------------------------------------
    

    @todo Use the deprecated method helper.
    DeprecationHelper helps modules support multiple versions of core

    Could also autowire the drush services.

  • 🇳🇱Netherlands basvredeling Amsterdam

    Why would you try to fix that phpstan message from #23 now @elc? It's a Drupal 12 deprecation, so D11 compatibility is ensured, which is the goal of this issue.

  • Pipeline finished with Success
    3 months ago
    #315093
  • 🇦🇺Australia elc

    "phpstan (next minor)" is set to a hard failure at present, and is this deprecation is thus holding back the issue. And, in 2 months when D11.1 is released, "phpstan" will hit the same hard failure. Seems like an ideal time to add a backwards compatible fix so it doesn't need to be revisited so soon.

    Change notice: LibraryDiscovery class is deprecated
    📌 Deprecate LibraryDiscovery and use LibraryDiscoveryCollector instead Fixed
    https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Core%21Asset%21L...

    The deprecation is from the service 'library.discovery' having its class replaced and combined with the one from 'library.discovery.collector', which is then being deprecated so that the original service is again the one to use. No need to change the service or even the interface, just the function call to flush the cache. This one was a bit confusing to figure out.

    All the hard fail tests now pass and this is ready for review. There doesn't appear to be much in the way of unit tests in this module.

  • Pipeline finished with Success
    3 months ago
    Total: 243s
    #315101
  • 🇦🇹Austria maxilein

    upgrade status also reports this:

    File name Line Error

    web/modules/contrib/fontawesome/modules/fontawesome_iconpicker_widget/src/Commands/FontawesomeIconPickerCommands.php 80 Call to deprecated function system_retrieve_file(). Deprecated in drupal:10.2.0 and is removed from drupal:11.0.0. There is no replacement.

    web/modules/contrib/fontawesome/src/Commands/FontawesomeCommands.php 80 Call to deprecated function system_retrieve_file(). Deprecated in drupal:10.2.0 and is removed from drupal:11.0.0. There is no replacement.

  • Status changed to Needs review about 1 month ago
  • 🇦🇺Australia interlated

    3465765-drupal-11-compatibility working for me.

  • 🇦🇺Australia elc

    Marking as RTBC on behalf of @interlated

  • 🇮🇳India sheshsharma

    MR!38 Makes this module compatible with Drupal 11. Functionality is working as expected.
    RTBC +1

  • 🇨🇦Canada joseph.olstad

    I sent messages to the two fontawesome maintainers about this issue.

  • 🇨🇦Canada smulvih2 Canada 🍁

    +1 let's get a new release!!!

  • 🇬🇧United Kingdom millnut

    RTBC +1, would be good to get a tagged release as this is the only module preventing me from updating to D11

  • 🇨🇦Canada joseph.olstad

    Some good news, the maintainer replied to a message sent by the PUWG, a release is expected next week!

    🐛 drupal/fontawesome Needs work

  • 🇺🇸United States platinum1

    +1 for a new release

  • 🇨🇦Canada joseph.olstad

    Warming up

  • 🇳🇴Norway truls1502 Oslo, Norway

    Released, and thank you for your patience.

Production build 0.71.5 2024