I wanted a rule to work only on the frontpage, but I can't do that since the path can't be empty. I ended up changing the module code. Perhaps other people face this issue as well?

Comments

jessehs’s picture

Title: Make the path paramter optinal » Support the <front> token for the 'equals' op
Issue summary: View changes
Status: Active » Needs review
StatusFileSize
new1.32 KB

I edited the issue to reflect the approach in the patch.

jp.stacey’s picture

@jessehs +1 - thank you, this is exactly what we've just been hoping to solve. Ideally the "value" would be non-required: when we edit the code to permit that, then a path of "" matches the front page! However, perhaps that has undefined behaviour when the operator is not "equals", so non-required isn't always safe.

For some reason your patch failed for me on the 'description' hunk, so please find a re-rolled patch. I have also changed == for === in your comparison: I think the latter is more in line with good practice recently mentioned by some core dev or other, because it avoids PHP casting ambiguity.

jp.stacey’s picture

Sorry, re-rolled patch attached now.

jp.stacey’s picture

The last patch did not apply cleanly during drush (re-)make, so I've re-rolled without the --no-prefix option and attached.

Poieo’s picture

Status: Needs review » Reviewed & tested by the community

Very simple and working well.

  • paranojik committed 445f2c3 on 7.x-1.x
    Issue #2057895 by jessehs,jp.stacey : Support the <front> token for the...
paranojik’s picture

Commited. Thanks everybody!

paranojik’s picture

Status: Reviewed & tested by the community » Fixed

  • paranojik committed 4d616d7 on 7.x-1.x authored by jessehs
    Issue #2057895 by jessehs,jp.stacey : Support the <front> token for the...
paranojik’s picture

Status: Reviewed & tested by the community » Fixed

This should be fixed.

Status: Fixed » Closed (fixed)

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