LulububuSoftwareGmbH / boltredirector

Handles 301 redirects in Bolt CMS.
16 stars 8 forks source link

ContextErrorException in Redirect.php line 109: #16

Closed poznet closed 6 years ago

poznet commented 7 years ago

Hmm Trying to test this extension . After installation and adding to config (boltredirector.sahassar.yml) redirects: oldkom: from: '/komputery.htm' to: '/kat/komputery'

when entering to komutery.htm i get

Uncaught Exception: ContextErrorException

ContextErrorException in Redirect.php line 109: Warning: Invalid argument supplied for foreach()

Google this Exception

Any idea what it is about ?

SvanteRichter commented 7 years ago

Sorry for the very late reply... :(

Did you add it like this:

redirects: oldkom: from: '/komputery.htm' to: '/kat/komputery'

Or like this?

redirects:
    oldkom:
        from: '/komputery.htm'
        to: '/kat/komputery'

I'm not sure if github simply mangled your code or if it was added like in the first example.

lenvanessen commented 7 years ago

Getting the same error here, it's because in de default YAML the variables: are empty, and the script doesn't check if the variables are set before trying to loop over them

I'll make a pull request, haven't dug into the code that much but it's a quick fix:)

SvanteRichter commented 6 years ago

Fixed in #20, no?