Hi,

I have created a module which extends fields functionality by adding ability to store fields values on per-domain basis if your site is driven by Domain access module. Module reuses all fields functionality and extends it with additional column in the field schema, widget and field loading. It works pretty well with other fields, but it fails on entity reference autocomplete request. The thing is entity reference checks field type inside autocomplete callback function entityreference_autocomplete_callback and returns MENU_ACCESS_DENIED if field type is not entityreference.

How about moving this access validation function to access callback? So that other modules can adjust access restrictions but still leverage other code without duplicating or modification it? Or perhaps we could just remove validation for field type, I think checking if user can edit this field should be sufficient.

Here are few patches:

  • autocomplete-no-field-type-validation.pathc - just remove field type validation
  • autocomplete-access-callback.pathc - Move access validation into access callback
  • autocomplete-access-callback-without-field-type-validation.pathc - Move access validation into access callback and remove field type validation.

It would be great if you committed one of this into dev branch.

Thanks,
Dmitry

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

zhgenti’s picture

Status: Active » Needs review
zhgenti’s picture

Any thoughts about it?

zhgenti’s picture

ping

amitaibu’s picture

Status: Needs review » Fixed

I've committed with some minor code style fixes -- autocomplete-access-callback.patch
Thanks.

Status: Fixed » Closed (fixed)

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