field_release_recommended doesn't get created on install, which then means that project nodes crash.

This is because the code to create the field is wrapped in this test:

  // Add a recommended toggle to the API taxonomy, if there is one.
  $api_vocabulary = taxonomy_vocabulary_load(variable_get('project_release_api_vocabulary', ''));
  if ($api_vocabulary !== FALSE) {
    field_create_field(array(
      'translatable' => '0',
      'settings' => array(
        'allowed_values' => array(
          0 => '',
          1 => $t('Recommended for project releases'),
        ),
        'allowed_values_function' => '',
      ),
      'field_name' => 'field_release_recommended',

AFAICT there is no code that takes care of creating that vocabulary. So the field will never get created.

CommentFileSizeAuthor
#6 2161823-6.patch985 bytesdww
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

drumm’s picture

Project: Drupal.org customizations » Project
Version: 7.x-3.x-dev » 7.x-2.x-dev
Component: Code » Releases

Yep, the API vocabulary-related code isn't the best. API vocabularies are meant to be optional, the field should be created when a vocabulary is configured to be an API vocabulary.

eabquina’s picture

Sad that I also encountered this as well...

As a workaround, I manually created field_release_recommended TEXT Field.

I thought first that making a Term Reference field fixes it, but I encountered a Field SQL error that it misses a field_recommended_release_value column.

No more errors when adding Releases. But now we see error:

    Notice: Undefined index: taxonomy_term in project_release_project_edit_form() (line 31 of /var/www/html/sites/all/modules/project/release/includes/project_edit_releases.inc).
    Warning: array_keys() expects parameter 1 to be array, null given in project_release_project_edit_form() (line 31 of /var/www/html/sites/all/modules/project/release/includes/project_edit_releases.inc).

Found this issue here but not really sure if it is related:
https://www.drupal.org/node/749166

foredoc’s picture

Same here...

Any solutions yet?

Thanks.

Regards,

foredoc

ajoboe’s picture

I'm having the same issue as techopsph and foredoc.

BartGysens’s picture

+1: having the same issue - even after reinstall...

EntityFieldQueryException: Unknown: field_release_recommended in EntityFieldQuery->addFieldCondition() (rule 841 in .../www_html/includes/entity.inc).

when I want to manage the releases

UPDATE: this helped me a little further: https://www.drupal.org/node/749166

Now bumping in this error:

Notice: Undefined index: taxonomy_term in project_release_project_edit_form() (rule 31 of ../sites/all/modules/project/release/includes/project_edit_releases.inc).
Warning: array_keys() expects parameter 1 to be array, null given in project_release_project_edit_form() (rule 31 of ../sites/all/modules/project/release/includes/project_edit_releases.inc).
dww’s picture

Status: Active » Needs review
FileSize
985 bytes

We're moving away from this vocabulary overall.
But until that happens, yeah, we should definitely create it on install, since so much depends on it (and things horribly explode if it doesn't exist).

  • dww committed aa11b59 on 7.x-2.x
    Issue #2161823 by dww: field_release_recommended doesn't get created on...
dww’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.