Problem/Motivation

TaggedHandlersPass is very hard to understand and while the class has useful error messages they are hidden. They are hidden because they only show up when the kernel.environment is not prod but we do not yet have a toggle for that and kernel.environment is always prod (aside from tests and update.php).

Proposed resolution

Do not run the if ($container->getParameter('kernel.environment') === 'prod') { continue; } chunks.

Remaining tasks

Figure out what to do with the code -- remove? comment out and do the same with the test.

User interface changes

None.

API changes

None. TaggedHandlersPass becomes slightly easier to use and that's a good thing because TaggedHandlersPass needs every bit of help it can towards usability.

CommentFileSizeAuthor
#9 drupal8.taggedhandlers-prod.9.patch3.6 KBsun
d8_thp_cruft.patch852 byteschx

Comments

Status: Needs review » Needs work

The last submitted patch, d8_thp_cruft.patch, failed testing.

chx’s picture

Status: Needs work » Needs review

So apparently there's a test for this being covered. I have no idea what's next, comment out and add a @TODO to add back when (if ever) #1537198: Add a Production/Development toggle happens?

chx’s picture

Issue summary: View changes
chx’s picture

Issue summary: View changes
chx’s picture

Title: Remove cruft from TaggedHandlersPass » Do not hide the error messages in TaggedHandlersPass
Issue summary: View changes
dawehner’s picture

dawehner’s picture

I would be fine with adding a @TODO and remove the current code and comment out the test. It is indeed a pain to work something which don't give you errors at all.

sun’s picture

Fine to remove that code for now, including the test methods.

When this condition was introduced, a prod/dev environment flag was very actively discussed and backed by code; so it was not unrealistic to assume that it would happen, but then the issue was rethought. If it is going to happen at some point, we can consider to restore the conditions + tests (or perhaps also not).

Note that there are two instances of the 'prod' condition in TaggedHandlersPass.

sun’s picture

StatusFileSize
new3.6 KB

Attached patch removes the conditions and the corresponding tests.

No test coverage is lost; the $env = 'prod' tests were intentionally split into separate unit test methods.

Status: Needs review » Needs work

The last submitted patch, 9: drupal8.taggedhandlers-prod.9.patch, failed testing.

sun’s picture

Status: Needs work » Needs review
chx’s picture

Status: Needs review » Reviewed & tested by the community

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 9: drupal8.taggedhandlers-prod.9.patch, failed testing.

sun’s picture

Status: Needs work » Needs review
dawehner’s picture

Status: Needs review » Reviewed & tested by the community

Great.

catch’s picture

Status: Reviewed & tested by the community » Fixed

Committed/pushed to 8.x, thanks!

  • Commit a10d5be on 8.x by catch:
    Issue #2259337 by sun, chx: Do not hide the error messages in...

Status: Fixed » Closed (fixed)

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