When viewing the Entityform Type import form there is a Notice

Notice: Undefined variable: bundle in entity_ui_get_page_title() (line 206 of /Applications/MAMP/htdocs/do_modules/d7_entityform_7_2/sites/all/modules/contrib/entity/entity.module).

This caused because of problem in entity_ui_get_page_title function provide by the Entity API

 if (isset($entity)) {
    list(, , $bundle) = entity_extract_ids($entity_type, $entity);
  }
  return entity_ui_get_action_title($op, $entity_type, $bundle);

There is no existing entity on import form so $bundle is undefined.

The uploaded patch fixes the issue.

Original Issue

Hi,
Under Import entityform type, thanks

Notice: Undefined variable: bundle in entity_ui_get_page_title() (line 749 modules\entity\includes\entity.ui.inc)

Comments

tedbow’s picture

Status: Active » Postponed (maintainer needs more info)

Sorry please provide more details

jetwodru’s picture

StatusFileSize
new11.5 KB

I just clicked Import Entityform type and this error shows. Thanks
importbug

mixael’s picture

Confirm. Same problem importing CRM Core contact types.

tedbow’s picture

Confirm. Same problem importing CRM Core contact type

Are those Entityform types?

jetwodru’s picture

Hi,
I'm NOT using CRM Core, I just clicked Import EntityForm type and the error showed. Thanks

mixael’s picture

Confirm. Same problem importing CRM Core contact type

Are those Entityform types?

I think yes.
Trying to import got:
Notice: Undefined variable: bundle in entity_ui_get_page_title() (line 749 of .....sites/all/modules/entity/includes/entity.ui.inc).

Interesting that same site configuration on different hostings work differently - on one all is OK (php version 5.2.17) on another with this error (php 5.2.10).

tedbow’s picture

Project: Entityform » Entity API
Version: 7.x-2.0-beta2 » 7.x-1.x-dev
Component: Code » Entity CRUD admin UI
Status: Postponed (maintainer needs more info) » Needs review
StatusFileSize
new409 bytes

Switching this to Entity API module. After updating to the entity-7.x-1.x branch the error changes to:

Notice: Undefined variable: bundle in entity_ui_get_page_title() (line 206 of ...../sites/all/modules/contrib/entity/entity.module).

Same problem but the function has moved.

The problem is there is no existing entity(or bundle) on import pages so entity_ui_get_page_title throughs error here:

if (isset($entity)) {
    list(, , $bundle) = entity_extract_ids($entity_type, $entity);
  }
  return entity_ui_get_action_title($op, $entity_type, $bundle);

I have attached a patch that fixes this.

tedbow’s picture

Title: Error with Import EntityForm Type » Error Bundle undefined with Entity Type Import page in entity_ui_get_page_title
Issue summary: View changes
jetwodru’s picture

Hi,
As tested, this does happen on Entityform 7.x.1.2 on a fresh drupal 7.24 installation. Currently, I'd decided to switch back to Entityforms 7.x.1.2 (no obviously known bugs so far except the Import EntityFormType ) coz 7.x.2.0 beta 2 still has many bugs as posted just now on a few threads after testing it on a fresh Drupal 7.24, not usable on production site. Thanks

Notice: Undefined variable: bundle in entity_ui_get_page_title() (line 749 of E:\Paul_E\Websites\Test\drupal724\sites\all\modules\entity\includes\entity.ui.inc).

rclemings’s picture

This patch (#7) works for me (Drupal 7.26, entity 7.x-1.3, entityform 7.x-2.0-beta2). Is there a reason it hasn't been committed to dev?

tedbow’s picture

tedbow’s picture

@rclemings, this issues was never set to RTBC..

Since it has been a couple months I set the patch to re-test.

This patch (#7) works for me (Drupal 7.26, entity 7.x-1.3, entityform 7.x-2.0-beta2). Is there a reason it hasn't been committed to dev?

When testing patches for the purpose of helping issues get committed you should also test against the dev version of the module being patched.

In this case Entity API 7.x-1.x-dev.

tedbow’s picture

ok the patch still passes tests.

@rclemings and others wanting to get this committed to Entity API. Please review/test against Entity API 7.x-1.x-dev.

If it works for you and you don't see any problem please set to Review and Tested by Community.

I am not a Entity API module maintainer so I can't commit this.

rclemings’s picture

Status: Needs review » Reviewed & tested by the community

It works with Entity API 7.x-1.x-dev as well. So I'll change the status as you asked.

fago’s picture

Status: Reviewed & tested by the community » Fixed

Thanks, committed.

Status: Fixed » Closed (fixed)

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