Hi,

I know this is a minor - but it was really irritating me as I get repeated notices whilst developing.

Within hook_tokens, a notice is thrown when trying to retrieve from $data[$type] - as no check is made to see if this object exists, prior to the assignment.

What I've done is add an array of types specific to hansel (to reduce the code needed to check the assignment) and then added the checks to the existing checks.

It makes more sense when you see the patch, which is attached.

- Rob

Comments

robinmofo’s picture

Status: Active » Needs review

Forgot to set to bot test .

robinmofo’s picture

Status: Needs review » Needs work

Bah, I committed the wrong ver!

robinmofo’s picture

Status: Needs work » Needs review
StatusFileSize
new1.26 KB

I'm so sorry - I've made a bit of a mess of this post within 5 mins!

Here is the correct patch ready for review.

ezeedub’s picture

StatusFileSize
new1.13 KB

New patch, slightly modified.

pgillis’s picture

This patch works for me. I couldn't apply directly, probably because I have some other patches applied already. That said, it was easy to apply manually and worked fine.

pgillis’s picture

Status: Needs review » Reviewed & tested by the community

Given my above comments in #5 it's been working for us in dev installation for a couple of months

robinmofo’s picture

And we've been using this in production for 6-7 months now.

mauritsl’s picture

Issue summary: View changes
Status: Reviewed & tested by the community » Fixed

Committed to GIT. Thanks!

  • mauritsl committed d47666e on 7.x-1.x
    Issue #1869630 by frobinrobin, ezeedub: Fix notices in hansel_tokens()
    

Status: Fixed » Closed (fixed)

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