Comments

joy29 created an issue. See original summary.

rudranil29’s picture

rudranil29’s picture

StatusFileSize
new23.54 KB

patch for drupal 9 compatibility

rudranil29’s picture

Assigned: rudranil29 » Unassigned
Status: Active » Needs review
margaritka.kurkul’s picture

Hello,

I got an error during applying the patch

error: patch failed: src/Controller/ScheduleController.php:13
error: src/Controller/ScheduleController.php: patch does not apply

Could you please check?

lexsoft00’s picture

Hi @margaritka.kurkul,

I've re-upload a patch for the latest dev release of business_rules. You will probably need to use this patch first prior to others and other patches might fail if they are depended on lines that are deprecated.

lexsoft00’s picture

StatusFileSize
new25.01 KB
lexsoft00’s picture

StatusFileSize
new25.03 KB

Fix toUrl() links on rule disable

lexsoft00’s picture

Status: Needs review » Needs work

Some of the changed functions need to be reviewed before added in.
I suggest until we have added tests to this module not to implement this.

BalajiDS’s picture

Issue summary: View changes

Remove Warning:

  • Add the line "core_version_requirement: ^8 || ^9" in business_rules.info.yml, br_group.info.yml & br_sms.info.yml files
mrinalini9’s picture

Assigned: Unassigned » mrinalini9
mrinalini9’s picture

Assigned: mrinalini9 » Unassigned
Status: Needs work » Needs review
StatusFileSize
new26.2 KB

Rerolled patch #8 as it failed to apply, along with the changes mentioned in #10, please review.

BalajiDS’s picture

Please review the patch

Lal_’s picture

Status: Needs review » Needs work

@BalajiDS please remove the unwanted patch files... and please provide the interdiff

Lal_’s picture

StatusFileSize
new28.45 KB
new3.95 KB
Lal_’s picture

Status: Needs work » Needs review
naresh_bavaskar’s picture

Assigned: Unassigned » naresh_bavaskar
naresh_bavaskar’s picture

Assigned: naresh_bavaskar » Unassigned
Status: Needs review » Needs work

found some minor deprecation code
Parameter $entity of method Drupal\business_rules\Plugin\EntityReferenceSelection\BusinessRulesViewsSelection::getParentFieldValue() has typehint with deprecated class Drupal\Core\Entity\Entity. Deprecated in drupal:8.7.0 and is removed from drupal:9.0.0. Use \Drupal\Core\Entity\EntityBase instead.

One thing which I don't know that should fix before fixing this issue:
These modules sub-modules (br_group,br_sms) are dependant on (dbug, sms, group) which are not ready for Drupal 9 so its dependent module having depreciation code their.

thanks!

colan’s picture

Status: Needs work » Postponed

As per #9, and other comments above, there are a lot of moving parts here so we need tests.

Please direct efforts towards #3154417: Create Test cases for major functionalities. first. Once that's done, we'll have a good basis for continuing here.

colan’s picture

tbcan’s picture

I hope this patch could help us to upgrade business_rules module to D9 ASAP.

colan’s picture

Status: Needs review » Postponed

#22: See #19. If you'd like to help, please start there.

Also, when uploading patches, always provide interdiffs. Please also explain the reason for the change in your comment. Otherwise, we have no idea how it differs from the previous one by taking a quick glance.

colan’s picture

Version: 8.x-1.x-dev » 2.x-dev
nwom’s picture

#21 no longer applied to the newest dev:

Checking patch config/schema/business_rules_action.schema.yml...
error: while searching for:
    to:
      type: string
      label: 'To'
    subject:
      type: text
      label: 'Subject'
    format:
      type: string
      label: 'Mail format'

error: patch failed: config/schema/business_rules_action.schema.yml:168
error: config/schema/business_rules_action.schema.yml: patch does not apply

It also removed the core info from the info files, which would prevent older D8 versions from working. I reversed this change. I also noticed that for some reason the subject is removed from the business_rules_action.schema.yml. I reversed this as well, until we have further clarification for the change.

Here is the new patch and the interdiff for both my patch and for tbcan's patch.

colan’s picture

This all looks good, except for some things that could be using dependency injection:

+++ b/src/Controller/ScheduleController.php
@@ -211,13 +212,13 @@ class ScheduleController extends ControllerBase implements ContainerInjectionInt
+      '%date'  => \Drupal::service('date.formatter')->format($schedule->getRevisionCreationTime()),

+++ b/src/Form/ScheduleForm.php
@@ -82,7 +82,7 @@ class ScheduleForm extends ContentEntityForm {
+      $entity->setRevisionCreationTime(\Drupal::time()->getRequestTime());

+++ b/src/Form/ScheduleRevisionDeleteForm.php
@@ -73,7 +73,7 @@ class ScheduleRevisionDeleteForm extends ConfirmFormBase {
+    return t('Are you sure you want to delete the revision from %revision-date?', ['%revision-date' => \Drupal::service('date.formatter')->format($this->revision->getRevisionCreationTime())]);

@@ -107,7 +107,7 @@ class ScheduleRevisionDeleteForm extends ConfirmFormBase {
+    $this->messenger()->addMessage(t('Revision from %revision-date of Schedule %title has been deleted.', ['%revision-date' => \Drupal::service('date.formatter')->format($this->revision->getRevisionCreationTime()), '%title' => $this->revision->label()]));

+++ b/src/Form/ScheduleRevisionRevertForm.php
@@ -120,7 +120,7 @@ class ScheduleRevisionRevertForm extends ConfirmFormBase {
+    \Drupal::messenger()->addMessage(t('Schedule %title has been reverted to the revision from %revision-date.', ['%title' => $this->revision->label(), '%revision-date' => $this->dateFormatter->format($original_revision_timestamp)]));

@@ -141,7 +141,7 @@ class ScheduleRevisionRevertForm extends ConfirmFormBase {
+    $revision->setRevisionCreationTime(\Drupal::time()->getRequestTime());

+++ b/src/Form/ScheduleRevisionRevertTranslationForm.php
@@ -107,7 +107,7 @@ class ScheduleRevisionRevertTranslationForm extends ScheduleRevisionRevertForm {
+    $revision->setRevisionCreationTime(\Drupal::time()->getRequestTime());

+++ b/src/Plugin/BusinessRulesAction/FetchEntityVariableAction.php
@@ -293,7 +293,7 @@ class FetchEntityVariableAction extends BusinessRulesActionPlugin {
+      \Drupal::messenger()->addError($e);

+++ b/src/Plugin/BusinessRulesAction/ShowMessage.php
@@ -66,8 +66,7 @@ class ShowMessage extends BusinessRulesActionPlugin {
+    \Drupal::messenger()->all($message, $message_type);

But it's good enough for the first alpha, and these things can be updated in a follow-up. We're still going to need tests for a stable release, however.

@NWOM: Thanks for getting these issues organized!

  • colan committed cd360e7 on 2.x authored by lexsoft00
    Issue #3073982 by lexsoft00, NWOM, Lal_, joy29, mrinalini9, BalajiDS,...
colan’s picture

Status: Postponed » Fixed

Status: Fixed » Closed (fixed)

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