When i try to install the SF entity i get
Fatal error: Call to undefined method stdClass::uri() in path_to_d7/sites/all/modules/entity/entity.module on line 850
and entire drupal become unusable.

As you can see i have installed entity module, last dev version.
As the entity module it's & it will be required by many others contrib modules, i think this should be fixed.

CommentFileSizeAuthor
#25 salesforce-entityapi-1207720.patch2.24 KBlevelos

Comments

EvanDonovan’s picture

Priority: Critical » Major

This doesn't happen when you have the Entity API module disabled, right? If you haven't tested that, can you?

I am moving this down to "major" priority, since I believe this is actually probably an upstream bug with Entity API or a module that uses the Entity API. That being said, brianV & I encountered it also, when we were testing Salesforce Entity + Profile2 (which requires Entity API). Thus, we will try to get it fixed shortly, since we will need to do so also.

EvanDonovan’s picture

Title: Fatal error on salesforce entity install, Entity module conflict » Salesforce Entity has fatal error on install when Entity API module is enabled
vasike’s picture

check with Entity module disabled and
it seems it works, no more errors & all entities type defined are present in the Drupal object selection of the Fieldmaps

EvanDonovan’s picture

Thanks. Yes, I think this is something with Entity API module itself. Are you also using Profile2?

vasike’s picture

no. but i intend to.

new tests. i think you're right.
i upgraded to the last dev of Entity module (july 5 - has 2 new commits).
Tried again and now it seems works.
I assume that was a Rules & Entity conflict error, as now i have also a Drupal Rule object present.
Anyway i think both of those packages Entity & Rules should be used for tests.

Please leave it open to do more test. Probably tomorrow i'll close it if there are no more errors.

EvanDonovan’s picture

Don't close it yet. I think there are conflicts that will need to be resolved.

Entity API is a module that is very much in flux. I will have to check carefully to make sure this module is and remains compatible.

EvanDonovan’s picture

I think perhaps the issue is coming in here, in the hook_menu implementation:

    $stub = entity_create_stub_entity($entity, $fake_ids);
    // Don't create a local task for entities with no uri callback - cf. #1042676: Undefined Index URI callback in sf_entity.
    if (empty($info['uri callback'])) {
      continue;
    }
    else {
      $uri_callback = $info['uri callback'];
      $uri = $uri_callback($stub);
    }

Creating a stub entity and then calling the uri callback on the stub entity is not sufficient for Entity API entities, I believe. I will keep looking into this.

EvanDonovan’s picture

Title: Salesforce Entity has fatal error on install when Entity API module is enabled » Salesforce Entity & Entity API-based modules: various incompatibilities (hook_menu, etc.)
Issue tags: +entity API

First things first: with my testing of the latest dev of Entity API, I was unable to reproduce the original error.

That being said, when I had Profile2 enabled, I did get a similar error - undefined variable stdClass::type().

I just committed a fix that should at least allow the sf_entity module to be enabled when Profile2 or other Entity API-based modules are enabled. It doesn't try to call the uri callback function for the Entity API-based entities, by checking to see whether they use the EntityAPIController.

This is just a temporary workaround though. I would like an actual solution, that would enable the local task to get added for Entity API-based entities for which it is appropriate. There are 2 problems though: 1) the stub entity is not sufficient to handle the relevant callbacks, 2) there are many different places in the Drupal menu system where the callbacks could place a uri, some of which wouldn't make sense for attaching a local task.

It would be difficult to come up with a generalized solution, but I don't want to do things on a case by case basis, either, except possibly for some very popular modules.

I am going to post in the Entity API & Profile2 issue queues to see if they can shed some light on what I want to do. It's not really a bug with their modules, just something that they didn't account for.

Also, I still have the following errors with Profile2 enabled:

• Warning: Missing argument 2 for sf_entity_salesforce_form_access() in sf_entity_salesforce_form_access()
• Notice: Undefined variable: entity in sf_entity_salesforce_form_access()
• Notice: Trying to get property of non-object in entity_extract_ids()

I am not 100% sure whether these are issues with Entity API generally, or just with Profile2 entities. For now, I am broadening this ticket to cover them.

EvanDonovan’s picture

Issue tags: +profile2
aaronbauman’s picture

I filed this issue #1280770: How do I retrieve the URI for a stub entity? to see if any Entity API folks can suggest a solution or a better approach.

EvanDonovan’s picture

Status: Active » Postponed

Seems like any further fix is postponed on #1280770: How do I retrieve the URI for a stub entity? for now.

mmoralessc’s picture

I'm getting this message I now I cant even access to my dashboard and how can I fixed1... please help!:

Fatal error: Cannot access empty property in /home1/allabpc2/public_html/testingusers/sites/all/modules/calendar/includes/calendar_plugin_row_node.inc on line 291

It is like I ost all what I had done!...

mmoralessc’s picture

Priority: Major » Critical
Status: Postponed » Active

I'm getting this message I now I cant even access to my dashboard and how can I fixed1... please help!:

Fatal error: Cannot access empty property in /home1/allabpc2/public_html/testingusers/sites/all/modules/calendar/includes/calendar_plugin_row_node.inc on line 291

It is like I ost all what I had done!...

mmoralessc’s picture

I'm getting this message I now I cant even access to my dashboard and how can I fixed1... please help!:

Fatal error: Cannot access empty property in /home1/allabpc2/public_html/testingusers/sites/all/modules/calendar/includes/calendar_plugin_row_node.inc on line 291

It is like I ost all what I had done!...

mmoralessc’s picture

I'm getting this message I now I cant even access to my dashboard and how can I fixed1... please help!:

Fatal error: Cannot access empty property in /home1/allabpc2/public_html/testingusers/sites/all/modules/calendar/includes/calendar_plugin_row_node.inc on line 291

It is like I lost all what I had done!...

aaronbauman’s picture

Priority: Critical » Major
Status: Active » Postponed

mmoralessc: that error issue is unrelated.
also please only press the submit button once.

sun’s picture

Issue tags: -entity API +Entity system
kostajh’s picture

Based on #1280770: How do I retrieve the URI for a stub entity? it looks like the problem is with entity_create_stub_entity, the solution is to use entity_create()

kostajh’s picture

Status: Postponed » Active
nicodv’s picture

Hello, im getting the same errors with profile 2.
Warning: Missing argument 2 for sf_entity_salesforce_form_access() in sf_entity_salesforce_form_access

Is there any patch for it? Do you know the reason why it happens?

Thanks a lot

Nco

kostajh’s picture

nicodv’s picture

Yes, thank you very much. Issue fixed.

Now i'm running all types of disgraces when enabling the entity form module:

Fatal error: Call to undefined method stdClass::uri() in /home/theveryl/public_html/kings/sites/all/modules/entity/entity.module on line 945

Any idea?

thanks again

kostajh’s picture

Status: Active » Postponed (maintainer needs more info)

What version of Entity API?

nicodv’s picture

Hi, 7.x-1.0-rc2.

Something else, I'm not getting it completely with Salesforce suite. Are there any tutorials I can learn more from? I see things like, if I delete a record in sf, it doesnt delete them in drupal, or I must make manual imports all the time or the IMPORT UPDATES button doesn't work...

Also, I'm getting this error all the time, I've googled it a zillion times, but maybe you can point me in the right direction with it: stdClass Object ( [created] => [errors] => Array ( [0] => stdClass Object ( [fields] => Array ( [0] => Name ) [message] => Account: bad field names on insert/update call: Name [statusCode] => INVALID_FIELD_FOR_INSERT_UPDATE ) ) [id] => [success] => )

Any help will be really welcome.

Thanks for helping

nico

levelos’s picture

Status: Postponed (maintainer needs more info) » Needs review
StatusFileSize
new2.24 KB

Here's a patch to make sf_entity work with the latest version of EntityAPI, at least in regards to the issues in sf_entity_menu(). I think a slight more efficient refactor could also be made, but I didn't want to make too many changes in this go around.

nicodv’s picture

Thanks, I'll give it a try, for the moment I learned a lot of "must-not-do's" and everything looks like working.

Thanks a lot for the help

kostajh’s picture

Status: Needs review » Fixed

Thank you, patch from #25 committed to 7.x-2.x. http://drupalcode.org/project/salesforce.git/commit/7166172

Status: Fixed » Closed (fixed)

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

muschpusch’s picture

Status: Closed (fixed) » Needs work

Sorry for reopening but this doesn't fix the issue. I'm using the current dev in combination with the recruiter install profile. I need to disable entity_api to access the admin pages :(

kostajh’s picture

Status: Needs work » Postponed (maintainer needs more info)

Might it be an incompatibility with Recruiter?

muschpusch’s picture

Status: Postponed (maintainer needs more info) » Closed (fixed)

Just wanted to edit this issue again. I disabled entity api and the path was accesible, i needed to apply #1651588: Not all entities have bundle keys even though i don't think it's related to these one. it works now :/ no idea why...