I have installed zuluru successfully but I am having a problem while adding a league. The website mysql does not seem to recognise the values sent the by the datapicker.js
Each time I try to add a league, I get the following error:
Warning (512): SQL Error: 1364: Field 'open' doesn't have a default value [CORE/cake/libs/model/datasources/dbo_source.php, line 684]
Query: INSERT INTO `leagues` (`affiliate_id`, `sport`, `season`, `is_open`, `schedule_attempts`, `display_sotg`, `stat_tracking`, `tie_breaker`, `name`, `sotg_questions`, `numeric_sotg`, `expected_max_score`) VALUES (1, 'soccer', 'Summer', 0, 100, 'all', 'never', 1, 'League 1', 'none', 0, 17)
As you can see, the mysql does not get any values from the league open dates although I have entered the right dates.
problem with datapicker
Re: problem with datapicker
Can you confirm that the type of the "open" column in the "leagues" table of the database is "date"? (I can't imagine why it wouldn't be, but if it's something else that would explain this nicely.)
Assuming that it is, can you change the debug setting in config/core.php to 2 (it might already be), and add the line "pr($this->data);" around line 240 of controllers/leagues_controller.php (right after "if (!empty($this->data)) {" is a good spot) and post the data you get from that?
Assuming that it is, can you change the debug setting in config/core.php to 2 (it might already be), and add the line "pr($this->data);" around line 240 of controllers/leagues_controller.php (right after "if (!empty($this->data)) {" is a good spot) and post the data you get from that?
Re: problem with datapicker
Thanks for your help Gregs,
I have checked the type for open and close and it is date. Here is the error that I get now after the addition with debug level 2
Array
(
[League] => Array
(
[name] => Football for All
[affiliate_id] => 1
[sport] => soccer
[season] => Summer
[Day] => Array
(
[0] => 7
)
[schedule_attempts] => 100
[sotg_questions] => none
[numeric_sotg] => 0
[display_sotg] => all
[tie_breaker] => 1
[expected_max_score] => 17
)
[Division] => Array
(
[name] => Football for All
[coord_list] =>
[capt_list] =>
[header] =>
[footer] =>
[open] => Array
(
[month] => 08
[day] => 08
[year] => 2014
)
[close] => Array
(
[month] => 09
[day] => 28
[year] => 2014
)
[roster_deadline] => Array
(
[month] => 08
[day] => 06
[year] => 2014
)
[ratio] => mens
[roster_rule] =>
[roster_method] => invite
[flag_membership] => 0
[flag_roster_conflict] => 1
[flag_schedule_conflict] => 1
[schedule_type] => none
[exclude_teams] => 0
[double_booking] => 0
[rating_calculator] => none
[email_after] => 0
[finalize_after] => 0
[allstars] => never
[allstars_from] => opponent
)
[q5] => 0
[q6] => 0
[q7] => 0
[q8] => 0
[q1] => 1
[q2] => 2
[q3] => 2
[q4] => 2
)
Warning (512): SQL Error: 1364: Field 'open' doesn't have a default value [CORE/cake/libs/model/datasources/dbo_source.php, line 684]
Query: INSERT INTO `leagues` (`affiliate_id`, `sport`, `season`, `is_open`, `schedule_attempts`, `display_sotg`, `stat_tracking`, `tie_breaker`, `name`, `sotg_questions`, `numeric_sotg`, `expected_max_score`) VALUES (1, 'soccer', 'Summer', 0, 100, 'all', 'never', 1, 'Football for All', 'none', 0, 17)
I have checked the type for open and close and it is date. Here is the error that I get now after the addition with debug level 2
Array
(
[League] => Array
(
[name] => Football for All
[affiliate_id] => 1
[sport] => soccer
[season] => Summer
[Day] => Array
(
[0] => 7
)
[schedule_attempts] => 100
[sotg_questions] => none
[numeric_sotg] => 0
[display_sotg] => all
[tie_breaker] => 1
[expected_max_score] => 17
)
[Division] => Array
(
[name] => Football for All
[coord_list] =>
[capt_list] =>
[header] =>
[footer] =>
[open] => Array
(
[month] => 08
[day] => 08
[year] => 2014
)
[close] => Array
(
[month] => 09
[day] => 28
[year] => 2014
)
[roster_deadline] => Array
(
[month] => 08
[day] => 06
[year] => 2014
)
[ratio] => mens
[roster_rule] =>
[roster_method] => invite
[flag_membership] => 0
[flag_roster_conflict] => 1
[flag_schedule_conflict] => 1
[schedule_type] => none
[exclude_teams] => 0
[double_booking] => 0
[rating_calculator] => none
[email_after] => 0
[finalize_after] => 0
[allstars] => never
[allstars_from] => opponent
)
[q5] => 0
[q6] => 0
[q7] => 0
[q8] => 0
[q1] => 1
[q2] => 2
[q3] => 2
[q4] => 2
)
Warning (512): SQL Error: 1364: Field 'open' doesn't have a default value [CORE/cake/libs/model/datasources/dbo_source.php, line 684]
Query: INSERT INTO `leagues` (`affiliate_id`, `sport`, `season`, `is_open`, `schedule_attempts`, `display_sotg`, `stat_tracking`, `tie_breaker`, `name`, `sotg_questions`, `numeric_sotg`, `expected_max_score`) VALUES (1, 'soccer', 'Summer', 0, 100, 'all', 'never', 1, 'Football for All', 'none', 0, 17)
Re: problem with datapicker
How strange that nobody has reported this before! Maybe a bug introduced fairly recently, as I have done some improvements to how leagues and divisions work together. This bug and a related one are now fixed, just pull the latest version from github and you should be good to go.
Re: problem with datapicker
Thank you Gregs,
Now I can easily add leagues and divisions
Now I can easily add leagues and divisions