1

I can update a field using Entity Metadata Wrapper (EMW). Here's how I can accomplish this.

$node_wrapper = entity_metadata_wrapper('node', $nid);
$node_wrapper->field_custom_field='new value';

However, I'm not able to access and update biblio fields provided by biblio module in the same way. This code won't work

 $node_wrapper->some_biblio_field='new value';

How can I update biblio fields using EMW?

  • Drupal 7 does not have CCK. It will mislead others. – Jimmy Ko Jul 22 '16 at 21:49
  • What is the module's version you are using? – Jimmy Ko Jul 22 '16 at 22:08
  • I'm using version 7.x-1.0-rc7 which is currently the latest version. and you are right CCK is misleading, so I removed that part. I actually meant the field API. – Amin S. Jul 23 '16 at 6:41
  • IMPO, the design of 1.x version of this module is really bad. I found that they had a 3.x version on Github. If it is a new project. It's worth to try. – Jimmy Ko Jul 24 '16 at 3:23
  • @ Jimmy, It is a very useful module and I have used it in several projects. They should start implementing it for Drupal 8 and not focus much on Drupal 7. – Amin S. Jul 27 '16 at 17:27
2

The Bibliography module isn't using D7's field API. It's misleading since the module's manage fields UI (/admin/structure/types/manage/biblio/fields) does make it appear as if it's using the field API; however it installs its own database schema for storing data for Bibliography nodes.

As such, Entity API's EMW isn't much help in your case.

| improve this answer | |
  • I had the same feeling, just wanted to make sure that this is the case. Thank you for the clarification. – Amin S. Jul 23 '16 at 6:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.