Hard-coded types are hard to maintain.

Comments

drumm created an issue. See original summary.

drumm’s picture

Status: Active » Needs review
StatusFileSize
new1.05 KB

Credit goes to B_man for this.

drumm’s picture

StatusFileSize
new1.04 KB

Cleaning up the patch.

drumm’s picture

This syntax isn’t compatible with PHP 5.3. I’d be okay with dropping support for PHP 5.3.

drumm’s picture

cod_schedule/plugins/content_types/cod_schedule_sessions_pane.inc could also use an update:

function cod_schedule_sessions_admin_page($node) {
  $content = array();
  $content['type_selector'] = array(
    '#type' => 'select',
    '#attributes' => array(
      'id' => 'schedule-items-type-select',
    ),
  );
  // TODO: In drupal8 we'll not do something bad like this
  if (module_exists('cod_session')) {
    $content['type_selector']['#options']['session'] = t('Session');
    …

We can not do bad things in Drupal 7, too.

b_man’s picture

StatusFileSize
new1.33 KB

yeah, let's do smart things in D7 :)

drumm’s picture

StatusFileSize
new3.57 KB

This is the combined patch for #6 & #3

drumm’s picture

StatusFileSize
new2.37 KB

Another patch snuck in, this should be better.