Problem/Motivation

When I try to select the "Current date" option (same issue applies for "Current node's creation time" and "Current node's update time") when providing a default value on a date argument' settings form I get the following error.

Drupal\Component\Plugin\Exception\PluginNotFoundException: The "date" plugin does not exist. in Drupal\Core\Plugin\DefaultPluginManager->doGetDefinition() (line 57 of /var/www/html/core/lib/Drupal/Component/Plugin/Discovery/DiscoveryTrait.php).

This is happening because ArgumentPluginBase::validateOptionsForm() and ArgumentPluginBase::submitOptionsForm() are looking for a plugin. These date arguments defaults are not plugin and are only defined within the date argument plugin.

Proposed resolution

Fix it. Add test coverage.

Remaining tasks

Fix it. Add test coverage.

User interface changes

None

API changes

None

Comments

geertvd created an issue. See original summary.

geertvd’s picture

Status: Active » Needs review
StatusFileSize
new2.49 KB
geertvd’s picture

Will remove that double enter in my next patch which should include test coverage.

geertvd’s picture

Patch in #2 Doesn't completely solve the issue yet.

geertvd’s picture

StatusFileSize
new1.87 KB
new2.87 KB

I think this is a better fix + test.

geertvd’s picture

Priority: Normal » Major

Bumping this to Major since this generates a php error.

The last submitted patch, 5: 2567773-5-test.patch, failed testing.

The last submitted patch, 5: 2567773-5-test.patch, failed testing.

rcodina’s picture

Issue tags: +Barcelona2015

Working on the major issue triage at DrupalCon Barcelona 2015

rcodina’s picture

Title: Can't select "current" date as default option in date arguments » Can't select "current date" as default option in a date contextual filter

Patch 2567773-5-complete.patch works for me, even on custom date fields. Now we should expect some experienced developer to also check this before setting this to RTBTC state.

valthebald’s picture

Status: Needs review » Needs work

Small typo: there's double "the" in test method docblock: "Tests the date default argument type on the the CreatedFullDate handler."

rcodina’s picture

Status: Needs work » Needs review
StatusFileSize
new2.86 KB
new168 bytes

Solved!

valthebald’s picture

Status: Needs review » Reviewed & tested by the community

We have evaluated the issue with @rcodina (me being a mentor) on the mentored major issue triage:

  1. We were able to reproduce the issue using intructions from the issue summary, using clean install
  2. Patch contains the test that fails without applied patch, and passes with applied patch
  3. We also performed manual testing, and ensured that patch solves the issue
  4. Patch in #12 is just a typo fix (interdiff attached)
  5. Therefore, RTBC
geertvd’s picture

Status: Reviewed & tested by the community » Closed (duplicate)

Actually this is handled better in #2325899: UI fatal caused by views argument handlers no longer being able to provide their own default argument handling, I'm going to close this as a duplicate. Perhaps we can move the test coverage to that ticket.

nathan tsai’s picture