Closed (fixed)
Project:
Version Control API
Version:
6.x-2.x-dev
Component:
API module
Priority:
Normal
Category:
Bug report
Assigned:
Issue tags:
Reporter:
Created:
17 Dec 2010 at 18:57 UTC
Updated:
15 Apr 2014 at 22:25 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
sdboyer commentedI'm not comfortable with this failing silently. Let's fix the problem, but make it error out if an empty value is passed.
Comment #2
marvil07 commentedComment #3
sdboyer commentedLet's improve the error message a bit by adding the name of the field that the empty condition is trying to be attached to. It'll make debugging a lot easier. With that change, it's RTBC.
Comment #4
marvil07 commentedBetter exception message:
Changing status as #3. I'mg going to commit this now.
Comment #5
marvil07 commentedCommitted!
Comment #7
sigveio commentedIn the table versioncontrol_repositories you have a field called update_method - which will be either 0 or 1, as per these:
Setting the update method to parse on cron, value 0, leads to the check introduced in the above patch failing and throwing the exception:
Which in turn leads to an uncaught exception and breaks the entire cron.php run completely. I'm assuming that is not intentional?
A caveat with with empty() is that is considers the following to be "empty":
It's therefore not suitable for checking if a mixed variable is "empty", where 0 is considered an acceptable "non-empty" value.
Comment #8
sdboyer commentedahh, good call, that should be an
isset().this'll be a problem with versioncontrol_git's cron hook...crap. i need to roll a new release before we deploy this to d.o.
Comment #9
sdboyer commentedk, pushed a fix, and tagging a new release. thanks for the report, hoesi.
Comment #10
marvil07 commentedI guess this appeared after the change on vc_git hook_cron to use controller condition to load only update-on-cron repositories instead of manual query(which was coherent and needed ;-)).
Sadly isset() does not handle the original case in this issue, so I am changing it a little an adding the attached patch to D6 and D7.
Thanks for reporting!