Problem/Motivation

Various methods in ContactForm use $this->get() and $this->set() to get and set protected properties.

Proposed resolution

Just set the properties direct

- return $this->get('recipients');
+ $this->recipients;

- $this->set('recipients', $recipients);
+ $this->recipients = $recipients;

Remaining tasks

Do it

User interface changes

None

API changes

None

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

tim-e’s picture

Status: Active » Needs review
FileSize
1.25 KB
larowlan’s picture

+++ b/core/modules/contact/src/Entity/ContactForm.php
@@ -81,45 +81,42 @@ class ContactForm extends ConfigEntityBundleBase implements ContactFormInterface
-    return $this;
+    $this->recipients = $recipients;
...
-    return $this;
+    $this->reply = $reply;
...
-    return $this;
+    $this->weight = $weight;

still needs the return $this

tim-e’s picture

larowlan’s picture

Status: Needs review » Reviewed & tested by the community

looks good, rtbc unless bot disagrees

  • catch committed 48e7c02 on 8.0.x
    Issue #2343787 by tim-e: Fix use of get() and set() in ContactForm...
catch’s picture

Status: Reviewed & tested by the community » Fixed

Committed/pushed to 8.0.x, thanks!

Status: Fixed » Closed (fixed)

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