Skip to main content
13 events
when toggle format what by license comment
Mar 5, 2017 at 19:50 history edited googletorp CC BY-SA 3.0
improved answer with best practice on using `entity_metadata_wrapper`.
Mar 18, 2014 at 23:51 comment added Garrett Albright Here's my approach based on what field_get_items() does: $langcode = field_language('node', $node, 'field_name'); $node->field_name[$langcode][0]['value'] = 'foo';
Jun 1, 2012 at 2:46 comment added Charlie Schliesser When I look over the source code for entity_metadata_wrapper and follow the rabbit trail through all of the classes that are instantiated and extended to give me easier field manipulation, I wonder if it's all worth it. Adding another 3k+ lines of code to my bootstrap and taking up more memory to deal with all of the variable assignments... is there anything more lightweight? It just seems that $node->field_name[LANGUAGE_NONE][0]['value'] = 'foo'; is really the most efficient way.
Apr 19, 2012 at 5:57 comment added Aditya M P Thank you guys, I was stupid not to read the answer properly and follow the link to the Entity API project page :)
Apr 16, 2012 at 18:37 comment added googletorp @adityamenon Like lazy says this is not in core... yet, it probably will be for Drupal 8. The entity APIs will at least be improve greatly. There wasn't really time do create all the APIs needed for the entity system for Drupal 7, so that is what the entity API module tries to achieve.
Apr 16, 2012 at 10:44 comment added lazysoundsystem aditya - this is in the Entity API module - not in core.
Apr 11, 2012 at 12:41 comment added Aditya M P Has this function entity_metadata_wrapper() been deprecated? I tried calling this in my module, and I got Fatal error: Call to undefined function entity_metadata_wrapper() - I also did a source search on my Drupal 7.12 installation in Dreamweaver, and came up with 0 results anywhere else in the code!
Mar 6, 2012 at 19:46 history edited avpaderno CC BY-SA 3.0
added 42 characters in body
S Mar 6, 2012 at 18:52 history suggested Merrick CC BY-SA 3.0
Changed to match API doc & tested usage
Mar 6, 2012 at 18:45 vote accept Merrick
Mar 6, 2012 at 18:44 review Suggested edits
S Mar 6, 2012 at 18:52
Mar 6, 2012 at 17:17 history edited Clive CC BY-SA 3.0
added missing quote in code
Mar 6, 2012 at 17:16 history answered googletorp CC BY-SA 3.0