Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Archive /

Our old forums are still available as a read-only archive.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo

Invalid error type specified


Go to End


2 Posts   2551 Views

Avatar
billy

Community Member, 9 Posts

27 September 2007 at 12:29pm

I got this today, when trying to do a bit of custom formy type guff:

Invalid error type specified
At line 293 in .../sapphire/security/Geoip.php

It appears that the 'ip2country' function tries to throw an error of type 'E_trigger_error' if it can't resolve a country from a given IP. Unfortunately this constant doesn't exist.

Strangely enough the error didn't occur on another machine running the same code base. This machine also would not have been able to resolve the IP as it also does not have the geoiplookup executable installed. I realise this could be due to all sort of factors, i.e. different php version, error_reporting level etc... I just though I would throw it in for good measure.

I was told (in irc) to post an elegant fix to this bug so that it can be resolved in the next version so here goes: How about change 'E_trigger_error' to 'E_WARNING'. There you go, it's so elegant it makes Princess Di look like Paris Hilton :D

Avatar
billy

Community Member, 9 Posts

27 September 2007 at 1:38pm

Let me be the first to correct myself....

It would seem that trigger_error does not allow for use of the 'E_WARNING' error type, there goes my elegant solution :/