Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
How to reproduce:
- create some ad groups
- create a new channel
- edit that channel to get the warning message
Message is removed after the first update of the channel.
Problem is in the 8th VALUE being specified as %d instead of '%s' in the INSERT query.
Fix:
@@ -1263,7 +1263,7 @@ function ad_channel_admin_channel_submit($form, &$form_state) {
}
switch ($form_state['values']['op']) {
case t('Create'):
- db_query("INSERT INTO {ad_channel} (name, description, conid, weight, display, no_channel_percent, urls, groups, inventory) VALUES('%s', '%s', %d, %d, %d, '%s', '%s', %d, %d)", $form_state['values']['name'], $form_state['values']['description'], $form_state['values']['conid'], $form_state['values']['weight'], $form_state['values']['display'], $form_state['values']['no_channel_percent'], serialize($urls), serialize($form_state['values']['groups']), $form_state['values']['inventory']);
+ db_query("INSERT INTO {ad_channel} (name, description, conid, weight, display, no_channel_percent, urls, groups, inventory) VALUES('%s', '%s', %d, %d, %d, '%s', '%s', '%s', %d)", $form_state['values']['name'], $form_state['values']['description'], $form_state['values']['conid'], $form_state['values']['weight'], $form_state['values']['display'], $form_state['values']['no_channel_percent'], serialize($urls), serialize($form_state['values']['groups']), $form_state['values']['inventory']);
drupal_set_message(t('The %name channel has been created.', array('%name' => $form_state['values']['name'])));
break;
case t('Update'):
Comments
Comment #1
Jeremy CreditAttribution: Jeremy commentedThanks for not only tracking this down, but also fixing it! Patch committed:
http://drupal.org/cvs?commit=277526