Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Attaching a patch to fix deprecation errors upon updating to D9.
Comment | File | Size | Author |
---|---|---|---|
#6 | interdiff.txt | 1.13 KB | Dom. |
#6 | prepare_for_d9--3156341-6.patch | 3.95 KB | Dom. |
#5 | prepare_for_d9--3156341-5.patch | 2.82 KB | Dom. |
#3 | 3156341-3.patch | 2.26 KB | karishmaamin |
social_post_d9.patch | 1.72 KB | thebumik | |
Issue fork social_post-3156341
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
Comment #2
nicrodgersPatch applies successfully and after applying upgrade_status reports just one warning:
Add core_version_requirement: ^8 || ^9 to designate that the module is compatible with Drupal 9.
Comment #3
karishmaamin CreditAttribution: karishmaamin commentedHere is the patch which adds core_version_requirement: ^8 || ^9 to .info.yml file
Comment #4
Suresh Prabhu Parkala CreditAttribution: Suresh Prabhu Parkala at Specbee commentedComment #5
Dom. CreditAttribution: Dom. as a volunteer and at ACINO commentedThanks for previous patch.
Unfortunately, I found that SocialPostEntityDeleteForm.php ultimately extends ContentEntityForm which have more injected services than that.
Here is a patch that fixes social_post on Drupal 9 as of today, as far as I went so far to configuration.
Comment #6
Dom. CreditAttribution: Dom. as a volunteer and at ACINO commentedPushing my usage of social_post and social_post_twitter for Drupal 9 to production.
I ended up with a little addition to patch #5, so here it is for review.
Comment #7
Rar9 CreditAttribution: Rar9 commentedPatch 6 doesnt apply with Drupal 9.14
- Installing drupal/social_post (2.0.0-beta3): Loading from cache
- Applying patches for drupal/social_post
https://www.drupal.org/files/issues/2020-11-06/prepare_for_d9--3156341-6... (Drupal 9 Compatibility)
Could not apply patch! Skipping. The error was: Cannot apply patch https://www.drupal.org/files/issues/2020-11-06/prepare_for_d9--3156341-6...
Comment #8
Dom. CreditAttribution: Dom. as a volunteer and at ACINO commented@Rar9: the patch applies on social_post module itself not on Drupal. So if the patch does not apply this is because of the version of social_post you use, not the Drupal one.
Maybe I did not mentionned it clearly enough, but the version in this issue is 8.x-2.x-dev so the patch applies not to the 8.0.0-beta3 but on the dev version (the upmost updated codebase) which you can get via composer or git.
I am not the module maintainer so I can help better than with patches. It is true that the whole Social API suite is promising but completely broken at the moment, at least on D9.
I managed to get it working properly on production for twitter auto-posting on an up-to-date D9. It required a lot of patching and I made a blog post about how to get it done : https://freelance-drupal.com/en/blog/automatically-tweet-published-content
You will see this patch #6 is part of the process and applies on dev.
Comment #9
Rar9 CreditAttribution: Rar9 commentedδm using composer workflow
"drupal/social_post": {
"Drupal 9 Compatibility": "https://www.drupal.org/files/issues/2020-11-06/prepare_for_d9--3156341-6..."
},
Composer update
Comment #10
Dom. CreditAttribution: Dom. as a volunteer and at ACINO commentedThat is exactly what I explained :
If using composer workflow, you have to require the dev version with your composer, not the beta3 !
Something like you do it:
composer require drupal/social_post:2.x-dev
Or even better as a best practice, by fixing it at a given commit, for instance :
composer require drupal/social_post:2.x-dev#53b58f3
Comment #11
Rar9 CreditAttribution: Rar9 commentedDom thanks it seams to partially work.
Removing drupal/social_post (2.0.0-beta3)
- Installing drupal/social_post (dev-2.x 53b58f3): Cloning 53b58f3 from cache
please explain where the #53b58f3 comes from.
If i then check status page i still get
The following modules are installed, but they are incompatible with Drupal 9.1.4:
Social Post
Social Post Twitter
Comment #12
Dom. CreditAttribution: Dom. as a volunteer and at ACINO commentedHi ! I suggest you to read the whole blog post I made to understand all modifications you have to do and follow them in details. It is not that easy to follow the whole process since D9 does not seem to be the module's author priority at the moment.
The issue with using composer is that the module as to be compatible with the version you want to actually patch it. Otherwise, you will need to apply the patch via git. Also the #53b58f3 is a specific commit on the dev branch. If you don't, every composer install will retry to install the dev branch with all it's new commit. Hence, it may break in the future if you don't fix to "sometimes in the timeline when it works" at least until the D9 patch is merged by the module maintainer.
You can find the commits on the module homepage click on 'commits'. For this module, it give you this page : https://www.drupal.org/node/2714419/commits where you will find the commit I mentionned.
Comment #13
Rar9 CreditAttribution: Rar9 commentedAfter Having applied your patch composer require drupal/social_post:2.x-dev#53b58f3
I still get
Mismatched entity and/or field definitions
The following changes were detected in the entity type and field definitions.
Social Post
The Link field needs to be installed.
The following modules are installed, but they are incompatible with Drupal 9.1.4:
Social Post
Social Post Twitter
Comment #14
Rar9 CreditAttribution: Rar9 commentedI cant believe NOBODY is using the AUTOPOST from Drupal.
THis MODULE is Simply not working do drupal 9
There is no Guide how to actually post ANYTHING
Under Drupal 6 the user got a TICKBOX when wanting to post to social twitter/facebook.
Comment #15
Dom. CreditAttribution: Dom. as a volunteer and at ACINO commentedHi !
I am using this on various D9 websites. You are totally right that the modules don't work "as-is". Plus, because the maintainer is not active, the patches we contribute are not getting reviewed / integrated which makes it kinda hard to use it.
In my comment #8 I have pointed to a how-to I have written. It is "hard to follow" in the sense that you have to precisely follow each steps which are important and will require a bit of glue-code (or the use of Rules module). But in the end, it's will works.
I wish you good luck with this :)
Comment #16
Rar9 CreditAttribution: Rar9 commentedwe might need another patch for drupal 9.2.x
Problem 1
- drupal/social_post 2.0.0-beta1 requires drupal/core ^2 -> found drupal/core[8.0.0-beta6, ..., 8.9.x-dev, 9.0.0-alpha1, ..., 9.3.x-dev] but it does not match the constraint.
- drupal/social_post[2.0.0-beta2, ..., 2.0.0-beta3] require drupal/core ~8.0 -> found drupal/core[8.0.0-beta6, ..., 8.9.x-dev] but the package is fixed to 9.2.0 (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command.
- Root composer.json requires drupal/social_post ^2.0@beta -> satisfiable by drupal/social_post[2.0.0-beta1, 2.0.0-beta2, 2.0.0-beta3].
Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.
Comment #17
Rar9 CreditAttribution: Rar9 commentedUsing this to get this installed under drupal 9.2
https://www.computerminds.co.uk/articles/apply-drupal-9-compatibility-pa... helps to install
Comment #19
nicrodgersI've updated the forked version to include the changes from patch #6.
Comment #20
wellsMR changes here are merged in to the 3.0.0-beta1 release as future development will happen on the 3.x branch. Please test there. Thanks, all!