Problem/Motivation

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

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:

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Shruthi Shetty M created an issue. See original summary.

Shruthi Shetty M’s picture

Status: Active » Needs review
FileSize
452 bytes
DamienMcKenna’s picture

Title: Add the 'core_version_requirement' key in info.yml » Make Feld Collection compatible with Drupal 9
Status: Needs review » Needs work

Let's combine this with #3185394: Removed function drupal_set_message(),entityManager(), entity_get_form_display(),strlen(),entity_get_display(). and make one patch / merge request that makes the module compatible with D9.

Frederikvho’s picture

Hi,

I combined the two patches like DamienMcKenna suggested.

DamienMcKenna’s picture

Status: Needs work » Needs review

Excellent, thank you @frederikvho.

Has anyone ran FC on Drupal 9 with the patches?

Frederikvho’s picture

Hi @damienmckenna,

Thanks for the quick feedback. I tried installing it but ran into PHP errors. Had to alter two more lines of deprecated code. So I have updated the patch.
However, after repeating the process with the updated version of the patch I am unable to add new field collections.

For reference see this screenshot:
screenshot field collections collection list

Not sure what the cause could be.

DamienMcKenna’s picture

Title: Make Feld Collection compatible with Drupal 9 » Make Feld Collection 8.x-3.x compatible with Drupal 9

FYI I uploaded the codebase as a merge request for people to use.

joaopauloscho’s picture

Has someone faced a composer conflict with drupal 9?

Problem 1
- Installation request for drupal/field_collection 3.x-dev@dev -> satisfiable by drupal/field_collection[3.x-dev].
- Conclusion: remove drupal/core 9.0.0
- Conclusion: don't install drupal/core 9.0.0
- drupal/field_collection 3.x-dev requires drupal/core ^8 -> satisfiable by drupal/core[8.0.x-dev, 8.1.x-dev, 8.2.x-dev, 8.3.x-dev, 8.4.x-dev, 8.5.x-dev, 8.7.x-dev, 8.8.x-dev, 8.9.x-dev].

XLD’s picture

@DamienMcKenna, shouldn't the MR be against 8.x-3.x branch? At the moment it is against 7.x.

DamienMcKenna’s picture

Status: Needs review » Needs work

Yeah, I think I borked up the merge request and made it against the 8.x-1.x branch instead of the 8.x-3.x branch. I've closed that one, so we'll need to create a new one.

jimkeller’s picture

#6 was largely working for us, except that when trying to add additional collections we got the error "Uncaught PHP Exception Drupal\Core\Security\UntrustedCallbackException: "Render #pre_render callbacks must be methods of a class that implements
\Drupal\Core\Security\TrustedCallbackInterface or be an anonymous function."

This is due to deprecated handling of #pre_render . The attached patch has everything from #6 along with a fix for the TrustedCallbackInterface problem.

Thanks to /u/atourino for the fix.

DamienMcKenna’s picture

Status: Needs work » Needs review
eleonel’s picture

In case you need to use this patch in your composer.json file you can do the following:

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

Then under require key

"drupal/field_collection": "dev-3185260-drupal-9"

aangel’s picture

Thanks for this, @eleonel. I also had to add the following exclusion key so that composer would look into the second repo:

        "drupal": {
            "type": "composer",
            "url": "https://packages.drupal.org/8",
            "exclude": ["drupal/field_collection"]
        },
SerShevchyk’s picture

The patch https://git.drupalcode.org/project/field_collection/-/merge_requests/4.diff works fine for me. I have tested with Upgrade Status module.

matt.hood made their first commit to this issue’s fork.

x775’s picture

Hi there

What is the current status on this effort?

Thanks!

DamienMcKenna’s picture

We need a maintainer to commit the changes.

  • fago committed 07ebe30 on 8.x-3.x authored by DamienMcKenna
    Issue #3185260: Make Feld Collection 8.x-3.x compatible with Drupal 9
    
fago’s picture

Status: Needs review » Fixed

Changes seem good to me and MR has positive test results, thus merged. Please re-open if there left issues.

fago’s picture

JCL324’s picture

Title: Make Feld Collection 8.x-3.x compatible with Drupal 9 » Make Field Collection 8.x-3.x compatible with Drupal 9

Status: Fixed » Closed (fixed)

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

drupalfan2’s picture

Category: Bug report » Task
Priority: Normal » Major

Please publish the first Drupal 9 version of field_collection on project page .