FYI - I have not gotten entities to work properly on a new server config (ie:#2331667: Drupal entity view pages )

On clear cache I still get:
Notice: Undefined index: type in civicrm_entity_get_field_type() (line 177 of /home/xxxx/public_html/beta/sites/all/modules/civicrm_entity/civicrm_entity.module).
Notice: Undefined index: type in civicrm_entity_get_field_type() (line 144 of /home/xxxx/public_html/beta/sites/all/modules/civicrm_entity/civicrm_entity.module).

not sure if related to same issue or no ...

CommentFileSizeAuthor
#5 civicrm_view_pages_permissions.patch2.24 KBmarkusa

Comments

markusa’s picture

I'm seeing the notices on module install, and on cache clear with the latest 2.x branch from githhub.

Can you describe what is not working properly....

the path /civicrm_contact/% is working for me on the latest version....

markusa’s picture

The notices there are complaining about the "world region" field. Its the only property that is coming back without a type. I don't think this should cause you any issues.

I'm not seeing the error mentioned in #2331667: Drupal entity view pages

Managing the display of CiviCRM entities and viewing them is working for me

markusa’s picture

nevermind, I was using the wrong version....

I see what you are talking about...

find the function civicrm_entity_temp_access() at the bottom of the civicrm_entity.module file...

to get it working for now, just comment out the check for civicrm_initalize() check and the comment out the CRM_Core_Permission check, and return true

like below:

function  civicrm_entity_temp_access($op,$num){
  /*if (!civicrm_intialize()) {
    return FALSE;
  }*/

  //return CRM_Core_Permission::check('administer CiviCRM', 'view all contacts');
  return true;
}
markusa’s picture

Well, trying to view contacts as anonymous is not working for me

I'm getting this :
"PDOException: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'message' cannot be null: INSERT INTO {watchdog}...'

Not sure why this would be the case....trying to figure out if its a permissions issue or what.

This is a strange one for me, when I view the page as admin, no watchdog messages are produced viewing as admin.

If I disable the dblog (Database and Logging) module, anonymous can view the contact

Eileen, any thoughts on why this condition may exist?

btw (the path is /civicrm-contact/%)

markusa’s picture

StatusFileSize
new2.24 KB

Ok, it was a unrelated issue with another module for the dblog error...nevermind on that

Here's a patch for improved permissioning for the view pages, this will be much better.

Eileen, used my judgement for the different permissions required for each entity. Let me know what you think.

The patch is against the 2.x branch on GitHub.

markusa’s picture

Now concerning the actually reported issue here:

On clear cache I still get:
Notice: Undefined index: type in civicrm_entity_get_field_type() (line 177 of /home/xxxx/public_html/beta/sites/all/modules/civicrm_entity/civicrm_entity.module).
Notice: Undefined index: type in civicrm_entity_get_field_type() (line 144 of /home/xxxx/public_html/beta/sites/all/modules/civicrm_entity/civicrm_entity.module).

Should we put a check in the function civicrm_entity_get_field_type() such as:

if(!isset($field_spec['type')) {
  return array('type' => 'text'); //or some other default value......integer? Figure text would cover the bases well
}

switch ($field_spec['type']) {
....
eileenmcnaughton’s picture

Ok - I've just committed that e-notice check

  • d13bbcd committed on 7.x-2.x
    #2372723 enotice fix
    
sonicthoughts’s picture

I still received this issue after updating to dev with the patch, however I believe the issue is releated to civicrm:
https://issues.civicrm.org/jira/browse/CRM-15514?jql=text%20~%20%22world...

The API is not returning a type for that field. I reported in JIRA and it shows fixed so this should go away in 4.6. I'm not sure if it makes sense to try to get in a point release as it could mess up other apps, but hopefully it is harmless :).

eileenmcnaughton’s picture

  • b61d6b7 committed on 7.x-2.x
    Load custom fields when loading entities, relates to #2399251 #220137#...
jkingsnorth’s picture

Status: Active » Fixed

This sounds fixed then if the patches here and in CiviCRM 4.6 fix the problem. We haven't been seeing these notices on our installation, but please do reopen the issue if it is still a problem.

Status: Fixed » Closed (fixed)

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