- π¬π§United Kingdom bmango
With this patch this module is working on D10 for me.
- Status changed to RTBC
over 1 year ago 9:56am 26 July 2023 Verified the #2 patch on 9.5.8, and 10.0.0 for drupal 10 compatibilty. Added screenshots for reference, RTBC++
- First commit to issue fork.
- πΊπΈUnited States hockey2112
Is there a planned Drupal 10 release date? I am trying to finish upgrading my D9 site to D10, and this module is holding it back. This is the message I am receiving from composer:
drupal/bg_img_field 1.7.0 requires drupal/core ^8 || ^9 -> satisfiable by drupal/core[8.0.0-beta6, ..., 8.9.20, 9.0.0-alpha1, ..., 9.5.10].
I applied the patch in this thread, and I am still receiving that message.
- π¬π§United Kingdom bmango
@hockey2112, you can always remove the module from your composer.json file then download the module manually and then apply the patch. Once the module has a release that is compatible with Drupal 10 then you can delete the module manually, and add it back into your composer.json file.
- πΊπΈUnited States hockey2112
I ended up going a different route:
- I already had Background Image Formatter installed. So I created a new image field using that module as a formatter.
- Then I installed filefield_paths and changed the file structure URL dir for the old background image field to "backgroundold". For new new field, I made the dir "backgroundnew".
- I exported the old background image field's DB table as CSV, removed the columns that don't exist for the newly-created image field that I am using as the new background image field, and then imported that CSV into the image field's db table.
- Then, I used a SQL statement on the file_managed table to change the dir for the existing background image files:
UPDATE file_managed SET uri = REPLACE(uri, 'backgroundold', 'backgroundnew') WHERE uri LIKE '%backgroundold%';
- Lastly, I deleted the old background image field and cleared cache, and then uninstalled and composer remove the bg_img_field module.
Might have been overkill, but it worked and it simplified and enhanced my setup as follows:
- I can now set an ALT on the image used for the background.
- I can now use IMCE to choose the image since this is just an image field. This will allow me to avoid uploading multiple copies of the same large background images.
- First commit to issue fork.
- πΊπΈUnited States NicholasS
For others who can't patch, here is how to switch to using the Forks Issue Branch.
Modify your composer.json as follows.
1. in your "repositories" : [ ] add the following into that array.{ "type": "composer", "url": "https://packages.drupal.org/8", "exclude": [ "drupal/bg_img_field" ] }, { "type": "vcs", "url": "https://git.drupalcode.org/issue/bg_img_field-3296632.git" },
Then run
composer require "drupal/bg_img_field:dev-8.x-1.x" --prefer-dist
to switch to using the forks branch.When this is merged you just have to remove those, and then composer require the official one again.
- πΊπΈUnited States hockey2112
@bmango, I had to do another Drupal 9 > 10 upgrade today, and this module was once again causing issues. I followed your advice, and it worked like a charm. Here were my steps:
- I moved the bg_img_field dir to the root dir, outside of the Drupal installation.
- I removed the bg_img_field line from composer.json.
- I ran composer update to upgrade to D10.
- I then created a new dir at public_html/modules/manual and added the bg_img_field dir there.
- I then ran update.php, and everything seems to be working great.
Thanks for your idea!
- Status changed to Fixed
6 months ago 10:02pm 23 May 2024 - Status changed to Fixed
6 months ago 10:11pm 23 May 2024