Problem/Motivation

D9.1.2 php 7.4
I just install smart_ip via composer and enabled it via drush and got the following message

[warning] Components 8.x-1.x API is deprecated in components:8.x-2.0 and is removed from components:3.0.0. Update the radix.info.yml file to replace the component-libraries.[namespace].paths data with components.namespaces.[namespace]. See https://www.drupal.org/node/3082817

CommentFileSizeAuthor
#9 components-API-3193046-09.patch766 byteskevinfunk

Issue fork radix-3193046

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

Rar9 created an issue. See original summary.

jcmartinez’s picture

This warning isn't caused by smart_ip; this warning comes from a recent update of the components module. In the case reported, the module components probably got updated while adding the smart_ip module or after performing a `composer update`.

I'm seeing the same warning on D8.9.12.

I'm actually seeing the warning twice because I have a sub-theme of Radix, in addition to Radix itself.

rar9’s picture

Thanks, good to know I'm not alone. Any way to fix this?

jcmartinez’s picture

I just pushed some code to the branch 3193046-components-api; however, my fix isn't good. After renaming the component key in my commit as indicated at https://www.drupal.org/project/components/issues/3091762, I get a following error:

Twig\Error\LoaderError: Template "@radix/navbar/navbar.twig" is not defined in "themes/contrib/radix/templates/page/page.html.twig" at line 8. in Twig\Loader\ChainLoader->getCacheKey() (line 142 of /app/vendor/twig/twig/src/Loader/ChainLoader.php).

I hope someone smarter than me can take it from here.

By the way, in my commit, I also made a small change to the composer.json file to ensure that the right version of the components module is required.

lunk rat’s picture

Same issue here. I tried editing my subtheme (and also radix.info.yml) to use the yml keys as outlined in https://www.drupal.org/project/components/issues/3091762 but this breaks my theme because it can't find components twig files.

rar9’s picture

Priority: Normal » Critical
lunk rat’s picture

Priority: Critical » Normal

Not a critical issue because it's only a deprecation warning and everything still works.

begrafx’s picture

I'm encountering this too... to tie everything together:

  1. New D9 project (9.1.2)
  2. DDEV Environment
  3. Installed the Paragraphs module via Composer
  4. Got error message in Status Report:
Mismatched entity and/or field definitions
The following changes were detected in the entity type and field definitions.
Paragraph

    The paragraph.bp_view field needs to be updated.

Attempted to update via Drush

$ ddev exec drush entity:updates
 [warning] Components 8.x-1.x API is deprecated in components:8.x-2.0 and is removed from components:3.0.0. Update the radix.info.yml file to replace the component-libraries.[namespace].paths data with components.namespaces.[namespace]. See https://www.drupal.org/node/3082817
 [warning] Components 8.x-1.x API is deprecated in components:8.x-2.0 and is removed from components:3.0.0. Update the [SUBTHEME].info.yml file to replace the component-libraries.[namespace].paths data with components.namespaces.[namespace]. See https://www.drupal.org/node/3082817

In UpdateDBCommands.php line 110:
                                                                               
  Drupal removed its automatic entity-updates API in 8.7. See https://www.dru  
  pal.org/node/3034742.                                                        
                                                                               

entity:updates [--cache-clear [CACHE-CLEAR]] [--no-cache-clear] [-h|--help] [-q|--quiet] [-v|vv|vvv|--verbose] [-V|--version] [--ansi] [--no-ansi] [-n|--no-interaction] [-d|--debug] [-y|--yes] [--no] [--remote-host REMOTE-HOST] [--remote-user REMOTE-USER] [-r|--root ROOT] [-l|--uri URI] [--simulate] [--pipe] [-D|--define DEFINE] [--druplicon] [--notify] [--xh-link XH-LINK] [--] <command>

Failed to execute command drush entity:updates: exit status 1

Google search on this error message lead me here.

kevinfunk’s picture

StatusFileSize
new766 bytes

Old way

component-libraries:
  RADIX_SUBTHEME_MACHINE_NAME:
    paths:
      - ./src/components

New way

components:
  namespaces:
    RADIX_SUBTHEME_MACHINE_NAME:
      - ./src/components
kevinfunk’s picture

Status: Active » Needs review
rar9’s picture

@kevinfunk

your patch doesn't seam to work .. If applied i still see the warning .... or do I need to update components?

kevinfunk’s picture

@Rar9 The patch only updates the warning for Radix. You will also need to update your subtheme.

In your subtheme edit RADIX_SUBTHEME_MACHINE_NAME.info.yml

replace

component-libraries:
  RADIX_SUBTHEME_MACHINE_NAME:
    paths:
      - ./src/components

with

components:
  namespaces:
    RADIX_SUBTHEME_MACHINE_NAME:
      - ./src/components

Update RADIX_SUBTHEME_MACHINE_NAME with the machine name of your subtheme.

The warning should have the name of the theme that is causing the warning.

If you are seeing the warning, you have the latest version of Components.

rar9’s picture

Thanks , that helped to remove the composer drush up error. :-)

phily’s picture

Thanks, patch #9 works using Drupal 8.9.13 and Radix 8.x-4.10
PS: don't forget to edit your custom subtheme as well (RADIX_SUBTHEME_MACHINE_NAME.info.yml file)

lunk rat’s picture

Status: Needs review » Reviewed & tested by the community

#9 worked for me against 8.x-4.10 on a D9 instance. Marking RTBC.

inst’s picture

Hi,
do I have to use the patch in #9 or can I do this manually too?

Message in Drupal 9:
Components 8.x-1.x API is deprecated in components:8.x-2.0 and is removed from components:3.0.0. Update the xyz.info.yml file to replace the component-libraries.[namespace].paths data with components.namespaces.[namespace]. See https://www.drupal.org/node/3082817

And will the solution be part to the next radix release?

thanks!

kreatil’s picture

+1

ckng made their first commit to this issue’s fork.

  • ckng committed 8d13b0d on 8.x-4.x authored by omarlopesino
    Issue #3193046 by kevinfunk, jcmartinez: components API
    

ckng credited omarlopesino.

ckng’s picture

Version: 8.x-4.10 » 8.x-4.x-dev
Status: Reviewed & tested by the community » Fixed

  • ckng committed 55040f2 on 8.x-4.x
    Issue #3193046 by ckng: updated to components API namespace
    

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.