Problem/Motivation

#2807785: Move global constants from *.module files into interfaces deprecated a bunch of constants but it did not actually replace their usage. We should do this. This issue handles COMMENT_ANONYMOUS_MAYNOT_CONTACT, COMMENT_ANONYMOUS_MAY_CONTACT and COMMENT_ANONYMOUS_MUST_CONTACT. This is a bug because we've deprecated something but we've not completed the task.

Proposed resolution

Use CommentInterface::ANONYMOUS_MAYNOT_CONTACT, CommentInterface::ANONYMOUS_MAY_CONTACT and CommentInterface::ANONYMOUS_MUST_CONTACT instead.

Remaining tasks

User interface changes

None

API changes

None

Data model changes

None

Comments

alexpott created an issue. See original summary.

alexpott’s picture

Status: Active » Needs review
StatusFileSize
new13.41 KB

After applying the patch the only instance of the deprecated constants is as expected.

grep -R COMMENT_ANONYMOUS_ ./core                                                                         1467ms  Fri 23 Nov 09:15:10 2018
./core/modules/comment/comment.module:const COMMENT_ANONYMOUS_MAYNOT_CONTACT = CommentInterface::ANONYMOUS_MAYNOT_CONTACT;
./core/modules/comment/comment.module:const COMMENT_ANONYMOUS_MAY_CONTACT = CommentInterface::ANONYMOUS_MAY_CONTACT;
./core/modules/comment/comment.module:const COMMENT_ANONYMOUS_MUST_CONTACT = CommentInterface::ANONYMOUS_MUST_CONTACT;

Status: Needs review » Needs work

The last submitted patch, 2: 3015697-2.patch, failed testing. View results

alexpott’s picture

Status: Needs work » Needs review
StatusFileSize
new1 KB
new12.4 KB

Arggh... we load the module file before updating the autoloader.

andypost’s picture

It is good to go but what if we deprecate bthis constants for few methods on field?

andypost’s picture

Status: Needs review » Reviewed & tested by the community

Used to try to fix autoloader and agree with #4

PS: in #5 I mean that it strange that this constants are on comment entity while they used specifically in comment field

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 4: 3015697-4.patch, failed testing. View results

alexpott’s picture

Status: Needs work » Reviewed & tested by the community
StatusFileSize
new12.49 KB

Rerolled. Minor conflict in \Drupal\comment\Plugin\Validation\Constraint\CommentNameConstraintValidator::validate() due to #2885809: The 'entity_type' and 'field_name' base fields on Comment are required

  • Gábor Hojtsy committed 000dbab on 8.7.x
    Issue #3015697 by alexpott, andypost: Properly deprecate...
gábor hojtsy’s picture

Status: Reviewed & tested by the community » Fixed

Thanks!

Status: Fixed » Closed (fixed)

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