Closed tabacco closed 12 years ago
I've fixed this with a pull request
Ran into this too. Hope they merge this. I found this thread first: http://fuelphp.com/forums/topics/view/6408
With this fix the oberserver works fine!
@billmn you didn't actually pull-request did you? The commit is shown here but I can't pull it using Github right now.
I've pulled a request here: https://github.com/fuel/orm/pull/144 Observer_Slug fix was appended into "Fixed label translation in validation messages (Fixed Issue #130)" ... what can I do?
I just noticed, for once it's not a problem as both will be accepted.
Solved by https://github.com/fuel/orm/pull/144
In the expression on line 61, the only match is optional, so preg_match() can return 1 and cause execution to enter the if statement even if there's no index trailing the slug.
If this happens, $matches[1] isn't set on line 64, triggering an E_NOTICE.
My cheap fix is to replace line 64 with
$index = isset($matches[1]) ? (int)$matches[1] : 0;