Closed (fixed)
Project:
Mass Contact
Version:
8.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
16 Nov 2020 at 14:12 UTC
Updated:
8 Nov 2021 at 22:24 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
gauravvvv commentedHere, I am providing a patch please verify if it is working or not.
Comment #3
tjtj commentedDoesa not work on 9.1.x
Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException: The service "mass_contact_confirm_info" has a dependency on a non-existent service "user.private_tempstore". in Symfony\Component\DependencyInjection\Compiler\CheckExceptionOnInvalidReferenceBehaviorPass->processValue() (line 86 of /home/briarcli/public_html/vendor/symfony/dependency-injection/Compiler/CheckExceptionOnInvalidReferenceBehaviorPass.php).
Comment #4
gauravvvv commentedThe only solution I found for this is explained in this blog post - https://www.computerminds.co.uk/articles/apply-drupal-9-compatibility-pa... - which basically boils down to:
- telling composer to use the source git repo for the package instead of using the official Drupal 'packages' repo
- (making sure you require the cweagans/composer-patches package)
- applying the patch in the normal way in composer.json inside "extra"
- then requiring the project - I did this yesterday after trying several things so I can't remember exactly whether it worked with composer require or composer update
Unfortunately I tried so many things before I got it working that I'm not yet entirely sure whether it worked due to the fact I added the bit mentioned in one of the comments in the blog post above, which is basically faking drupal 9 to be 'seen' as drupal 8:
"drupal/core": "9.1.4 as 8.9.99",So if you would still have an issue after the points above then can always try this.
But anyway, back to the point, the patch works great and the theme installs and works great after this one line patch so I'd say the quicker it gets committed the less people would have to struggle requiring it on a new D9 site.
Comment #5
mvogel commentedNeeded to remove the information added by the Drupal.org packaging script to apply the patch correctly.
Comment #6
mvogel commentedI ran drush upgrade_status and fixed the points below + the info yml problem
drush us-a mass_contact
[notice] Processing /var/www/web/modules/contrib/mass_contact.
================================================================================
Mass Contact, 8.x-1.0-beta2
Scanned on Mo., 19.04.2021 - 08:08
FILE: web/modules/contrib/mass_contact/src/Form/MassContactForm.php
STATUS LINE MESSAGE
--------------------------------------------------------------------------------
Fix now 69 Parameter $entity_manager of method
Drupal\mass_contact\Form\MassContactForm::__construct() has
typehint with deprecated interface
Drupal\Core\Entity\EntityManagerInterface. Deprecated in
drupal:8.0.0 and is removed from drupal:9.0.0.
--------------------------------------------------------------------------------
Fix now 69 Parameter $temp_store_factory of method
Drupal\mass_contact\Form\MassContactForm::__construct() has
typehint with deprecated class
Drupal\user\PrivateTempStoreFactory. Deprecated in
drupal:8.5.0 and is removed from drupal:9.0.0. Use
Drupal\Core\TempStore\PrivateTempStoreFactory instead.
--------------------------------------------------------------------------------
FILE:
web/modules/contrib/mass_contact/src/Form/MassContactMessageConfirmForm.php
STATUS LINE MESSAGE
--------------------------------------------------------------------------------
Fix now 74 Parameter $temp_store_factory of method
Drupal\mass_contact\Form\MassContactMessageConfirmForm::__co
nstruct() has typehint with deprecated class
Drupal\user\PrivateTempStoreFactory. Deprecated in
drupal:8.5.0 and is removed from drupal:9.0.0. Use
Drupal\Core\TempStore\PrivateTempStoreFactory instead.
--------------------------------------------------------------------------------
FILE: web/modules/contrib/mass_contact/src/MessageListBuilder.php
STATUS LINE MESSAGE
--------------------------------------------------------------------------------
Fix now 45 Call to deprecated method getStorage() of class
Drupal\Core\Entity\EntityManager. Deprecated in drupal:8.0.0
and is removed from drupal:9.0.0. Use
Drupal\Core\Entity\EntityTypeManagerInterface::getStorage()
instead.
--------------------------------------------------------------------------------
FILE:
web/modules/contrib/mass_contact/src/ParamConverter/MassContactConfirmConverter.
php
STATUS LINE MESSAGE
--------------------------------------------------------------------------------
Fix now 27 Parameter $temp_store_factory of method
Drupal\mass_contact\ParamConverter\MassContactConfirmConvert
er::__construct() has typehint with deprecated class
Drupal\user\PrivateTempStoreFactory. Deprecated in
drupal:8.5.0 and is removed from drupal:9.0.0. Use
Drupal\Core\TempStore\PrivateTempStoreFactory instead.
--------------------------------------------------------------------------------
FILE:
web/modules/contrib/mass_contact/src/Plugin/MassContact/GroupingMethod/GroupingI
nterface.php
STATUS LINE MESSAGE
--------------------------------------------------------------------------------
Check manually 13 Interface
Drupal\mass_contact\Plugin\MassContact\GroupingMethod\Groupi
ngInterface extends deprecated interface
Drupal\Component\Plugin\ConfigurablePluginInterface:
Drupal\Component\Plugin\ConfigurablePluginInterface is
deprecated in Drupal 8.7.0 and will be removed before Drupal
9.0.0. You should implement ConfigurableInterface and/or
DependentPluginInterface directly as needed. If you
implement ConfigurableInterface you may choose to implement
ConfigurablePluginInterface in Drupal 8 as well for maximum
compatibility, however this must be removed prior to Drupal
9.
--------------------------------------------------------------------------------
FILE: web/modules/contrib/mass_contact/src/Tests/Form/AdminSettingsFormTest.php
STATUS LINE MESSAGE
--------------------------------------------------------------------------------
Fix now 14 Class Drupal\mass_contact\Tests\Form\AdminSettingsFormTest
extends deprecated class
Drupal\system\Tests\System\SystemConfigFormTestBase.
Deprecated in drupal:8.6.0 and is removed from drupal:9.0.0.
Use \Drupal\KernelTests\ConfigFormTestBase instead.
--------------------------------------------------------------------------------
Fix now 27 Call to method setUp() of deprecated class
Drupal\simpletest\WebTestBase. Deprecated in drupal:8.6.0
and is removed from drupal:9.0.0. Use
\Drupal\KernelTests\ConfigFormTestBase instead.
--------------------------------------------------------------------------------
FILE: web/modules/contrib/mass_contact/src/Tests/Form/EmailBodyFormTest.php
STATUS LINE MESSAGE
--------------------------------------------------------------------------------
Fix now 13 Class Drupal\mass_contact\Tests\Form\EmailBodyFormTest
extends deprecated class
Drupal\system\Tests\System\SystemConfigFormTestBase.
Deprecated in drupal:8.6.0 and is removed from drupal:9.0.0.
Use \Drupal\KernelTests\ConfigFormTestBase instead.
--------------------------------------------------------------------------------
Fix now 26 Call to method setUp() of deprecated class
Drupal\simpletest\WebTestBase. Deprecated in drupal:8.6.0
and is removed from drupal:9.0.0. Use
\Drupal\KernelTests\ConfigFormTestBase instead.
--------------------------------------------------------------------------------
FILE: web/modules/contrib/mass_contact/src/Tests/Form/EmailHeaderFormTest.php
STATUS LINE MESSAGE
--------------------------------------------------------------------------------
Fix now 14 Class Drupal\mass_contact\Tests\Form\EmailHeaderFormTest
extends deprecated class
Drupal\system\Tests\System\SystemConfigFormTestBase.
Deprecated in drupal:8.6.0 and is removed from drupal:9.0.0.
Use \Drupal\KernelTests\ConfigFormTestBase instead.
--------------------------------------------------------------------------------
Fix now 27 Call to method setUp() of deprecated class
Drupal\simpletest\WebTestBase. Deprecated in drupal:8.6.0
and is removed from drupal:9.0.0. Use
\Drupal\KernelTests\ConfigFormTestBase instead.
--------------------------------------------------------------------------------
FILE:
web/modules/contrib/mass_contact/tests/src/Kernel/CategoryAccessControlHandlerTe
st.php
STATUS LINE MESSAGE
--------------------------------------------------------------------------------
Fix now 16 Usage of deprecated trait
Drupal\simpletest\UserCreationTrait in class
Drupal\Tests\mass_contact\Kernel\CategoryAccessControlHandle
rTest. Deprecated in drupal:8.4.0 and is removed from
drupal:9.0.0. Use
Drupal\Tests\user\Traits\UserCreationTrait instead.
--------------------------------------------------------------------------------
FILE:
web/modules/contrib/mass_contact/tests/src/Kernel/Entity/MassContactCategoryTest
.php
STATUS LINE MESSAGE
--------------------------------------------------------------------------------
Fix now 20 Usage of deprecated trait
Drupal\simpletest\UserCreationTrait in class
Drupal\Tests\mass_contact\Kernel\Entity\MassContactCategoryT
est. Deprecated in drupal:8.4.0 and is removed from
drupal:9.0.0. Use
Drupal\Tests\user\Traits\UserCreationTrait instead.
--------------------------------------------------------------------------------
FILE: web/modules/contrib/mass_contact/tests/src/Kernel/MassContactTest.php
STATUS LINE MESSAGE
--------------------------------------------------------------------------------
Fix now 18 Usage of deprecated trait
Drupal\simpletest\UserCreationTrait in class
Drupal\Tests\mass_contact\Kernel\MassContactTest. Deprecated
in drupal:8.4.0 and is removed from drupal:9.0.0. Use
Drupal\Tests\user\Traits\UserCreationTrait instead.
--------------------------------------------------------------------------------
FILE: web/modules/contrib/mass_contact/tests/src/Kernel/OptOutTest.php
STATUS LINE MESSAGE
--------------------------------------------------------------------------------
Fix now 18 Usage of deprecated trait
Drupal\simpletest\UserCreationTrait in class
Drupal\Tests\mass_contact\Kernel\OptOutTest. Deprecated in
drupal:8.4.0 and is removed from drupal:9.0.0. Use
Drupal\Tests\user\Traits\UserCreationTrait instead.
--------------------------------------------------------------------------------
FILE:
web/modules/contrib/mass_contact/tests/src/Kernel/Plugin/MassContact/GroupingMet
hod/RoleTest.php
STATUS LINE MESSAGE
--------------------------------------------------------------------------------
Fix now 19 Usage of deprecated trait
Drupal\simpletest\UserCreationTrait in class
Drupal\Tests\mass_contact\Kernel\Plugin\MassContact\Grouping
Method\RoleTest. Deprecated in drupal:8.4.0 and is removed
from drupal:9.0.0. Use
Drupal\Tests\user\Traits\UserCreationTrait instead.
--------------------------------------------------------------------------------
Comment #7
mvogel commentedOne point missing, updated patch
Comment #8
mlncn commentedThis patch is mvogel's unchanged *except* it should apply now because i removed the extra
a/mass_contact/etc. in front of every chunk— the patch works from the perspective of the module itself, not the contrib directory or such.Comment #9
mlncn commentedPatch that fully applies on fresh git checkout.
Comment #11
mlncn commentedThe test that's failing looks to be an empty shell. Near as i can tell it's something of a false failure (in the module itself, the message_prefix and message_suffix look to always be correctly initialized as a text_format— format and value), but i can't identify why it's failing now or how to fix it easily.
Comment #12
bsztreha commentedFound the fix for test failure
Drupal\Tests\mass_contact\Functional\Form\MassContactFormTestNeed to replace old private storage:
$store = \Drupal::service("user.private_tempstore")->get('mass_contact_confirm_info');to new
$store = \Drupal::service("tempstore.private")->get('mass_contact_confirm_info');in
submitForm()Edit: The other failures come from these modifications:
So need to finish
mass_contact/src/Tests/Form/EmailBodyFormTest.php$valuespart, but I am not aware of this kind of testComment #14
mlncn commentedAh good! I hadn't looked as far as that test! Was stuck on EmailBodyFormTest which i still suspect isn't "our fault".
I think because Drupal core module dependencies are listed in the .info.yml file, Drupal.org generates a composer.json with a requirement specifically for Drupal 8 (since that is what is defined in the .info.yml). To use a D9-compatible version of Mass Contact in a composer-managed project then i'll create an issue fork based on bsztreha's latest patch — that is here: git@git.drupal.org:issue/mass_contact-3182772.git
Can be used per https://www.drupal.org/docs/develop/git/using-git-to-contribute-to-drupa... for using Mass Contact with a D9 site.
Comment #17
jhedstromThanks all! I've merged the above patch into a branch and fixed the failing tests and deprecations. I'll merge the MR once tests pass.
Comment #19
jhedstromThanks all! I've tagged a new release to include this fix.
Comment #20
jhedstrom