Tried to install this module with Drupal 9.1.10 and it failed because of an outdated patch.
Updating to https://www.drupal.org/files/issues/2021-06-03/2685749-92.patch works.

CommentFileSizeAuthor
#2 3218659-1.patch480 bytestvalimaa
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

weseze created an issue. See original summary.

tvalimaa’s picture

StatusFileSize
new480 bytes

Made patch

kiwimind’s picture

Status: Active » Reviewed & tested by the community

Having had this failure during an upgrade from D8 to 9.2.5, this patch does now fix the problem.

In case it helps anyone, you're unable to use this patch via composer due to the order of execution. We've had to move this contrib module in the custom directory and apply the patch there, which allows the upgrade to complete. Not looked in to moving it back yet.

Thanks for the updated patch.

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

radimklaska’s picture

As mentioned, patching composer is tricky. Issue forks for the rescue.

I opened a new fork, applied the patch and created a merge request.

Here is how to use the fork before this gets merged:
* read https://www.drupal.org/docs/develop/git/using-git-to-contribute-to-drupa...
* composer.json:

...
    "repositories": [
        {
            "type": "composer",
            "url": "https://packages.drupal.org/8",
            "exclude": [
                "drupal/machine_name_widget"
            ]
        },
        {
            "type": "git",
            "url": "https://git.drupalcode.org/issue/machine_name_widget-3218659.git"
        }
    ],
...

* composer require drupal/machine_name_widget:"dev-3218659-update-core-patch"

progzy’s picture

@radimklaska -> thank you for the tip and the link. However I have 2 questions:

EDIT: I've found the answer for one of them.

1/ About the tip

what to do if you have a dependency? In my case I have the "block_content_machine_name" module that I forked because it needs "drupal/machine_name_widget": "^2.0" whereas it has currently "drupal/machine_name_widget": "^1.0".
Because of this dependency I get

  Problem 1
    - drupal/block_content_machine_name is locked to version dev-3239489-compatibility-issue-with and an update of this package was not requested.
    - drupal/block_content_machine_name dev-3239489-compatibility-issue-with requires drupal/machine_name_widget ^2.0 -> found drupal/machine_name_widget[dev-8.x-2.x, 2.x-dev (alias of dev-8.x-2.x)] but it conflicts with your root composer.json require (dev-3218659-update-core-patch).

when I run

composer require drupal/machine_name_widget:"dev-3218659-update-core-patch"

EDIT: the solution is to use aliases as described here: https://getcomposer.org/doc/articles/aliases.md then proceed with

composer require drupal/machine_name_widget:"dev-3218659-update-core-patch as 2.x-dev"

2/ Why is the patch / or module necessary?

I wonder since it is written on the main page of the module that it will be useless once integrated in the core. Isn't that a kind of duplicate? I may have missed something.

Thank you.

usmanjutt84’s picture

This patch is not work with PHP 7.4 & MySQL 5.7 and Drupal 9.3.0.

trickfun’s picture

Yes, patch doesn't work.
Can you fix?

The bug is blocking

Thank you

trickfun’s picture

No response?
is this module still alive?

tvalimaa’s picture

You need to follow https://www.drupal.org/project/drupal/issues/2685749 and use latest patch which is currently https://www.drupal.org/files/issues/2021-12-29/2685749-101.patch.

I didn't check what this module actual do because this module was just one project what I got. My solution was patch this module with my https://www.drupal.org/files/issues/2021-07-09/3218659-1.patch patch and move this module folder under modules/custom.

Ruslan Piskarov made their first commit to this issue’s fork.

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

ankondrat4’s picture

Hello.
I have changed patch for working with Drupal 9.5.8.

ankondrat4’s picture

Version: 8.x-2.0-alpha2 » 8.x-2.x-dev
Status: Reviewed & tested by the community » Fixed
ankondrat4’s picture

Version: 8.x-2.x-dev » 3.0.x-dev
Status: Fixed » Closed (fixed)
ankondrat4’s picture

tgoeg’s picture

tgoeg’s picture

Sorry - the patch itself is correct. It's just composer-patches that messes things up in case of newly created files.
Because it tries all values of patch's -p0 till -p4, it creates new files everywhere. Currently investigating how to prevent that.