Steps to reproduce:
1. Visit the 'create issue' form on a project (e.g. http://git7site.devdrupal.org/node/add/project_issue/drupal)
2. Enter garbage text in the 'Project' select box
3. Hit 'tab' to shift focus out of the project box

Result:

    Notice: Trying to get property of non-object in project_issue_project_issue_assignees() (line 2194 of /var/www/git-dev.drupal.org/htdocs/sites/all/modules/project_issue/project_issue.module).
    Notice: Trying to get property of non-object in project_issue_project_issue_assignees() (line 2194 of /var/www/git-dev.drupal.org/htdocs/sites/all/modules/project_issue/project_issue.module).
    Warning: array_flip(): Can only flip STRING and INTEGER values! in DrupalDefaultEntityController->load() (line 173 of /var/www/git-dev.drupal.org/htdocs/includes/entity.inc).
    Notice: Trying to get property of non-object in project_issue_set_breadcrumb() (line 711 of /var/www/git-dev.drupal.org/htdocs/sites/all/modules/project_issue/project_issue.module).
    Notice: Trying to get property of non-object in project_project_get_breadcrumb() (line 319 of /var/www/git-dev.drupal.org/htdocs/sites/all/modules/project/project.module).
    Notice: Trying to get property of non-object in project_project_get_breadcrumb() (line 320 of /var/www/git-dev.drupal.org/htdocs/sites/all/modules/project/project.module).
    Notice: Trying to get property of non-object in project_project_get_breadcrumb() (line 320 of /var/www/git-dev.drupal.org/htdocs/sites/all/modules/project/project.module).

Comments

jthorson’s picture

For some reason, I simply can't get a form_error() inside project_issue_field_project_validate() to display and/or prevent the AJAX submission ...

function project_issue_field_project_validate($element, &$form_state) {
  if (empty($form_state['values']['field_project'][LANGUAGE_NONE][0]['target_id'])) {
    // Not sure why form_error is not working here, but the dsm() appears.
    drupal_set_message("Invalid project", 'error');
    form_error($element, t("Error"));
  }
  else {
    // Always update the node entity saved in form_state in order to allow other
    // fields to be populated with correct values (e.g. 'field_issue_assigned').
    $form_state['node']->field_project[LANGUAGE_NONE][0]['target_id'] = $form_state['values']['field_project'][LANGUAGE_NONE][0]['target_id'];
  }
}
jthorson’s picture

Also, after typing inside the 'Project' box and moving out, the AJAX processing tends to hang firefox for 5-8 seconds ... this may need a closer look.

drumm’s picture

Assigned: Unassigned » drumm
drumm’s picture

Status: Active » Fixed

http://drupalcode.org/project/project_issue.git/commit/d564e5a fixes most of the notices. #1683964: Entity Reference Error (array_flip, undefined target_id) when using autocomplete and no entites selected is the remaining notice.

I did notice Firefox hanging intermittently. It feels like it is happening after the AJAX callback finishes, when the new form bits get out into the DOM. We may be able to work around this with different JS, or maybe Firefox will clean it up as they improve their JS engine. I don't think it is worth worrying about here.

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