0

I'm trying to bulk update image tags using entity_metadata_wrapper.

I'm unable to see the image field when I use $emw->getPropertyInfo().

The bundle is called hub_page.

The code I'm using is:

$wrapper = entity_metadata_wrapper('node', $node_id, array('bundle' => 'hub_page'));
var_dump($wrapper->getPropertyInfo());

Is this the correct way?

2

You must pass in a node object as the second value, instead of a node ID.

$node = node_load($node_id);
$wrapper = entity_metadata_wrapper('node', $node, ['bundle' => 'hub_page']);

That might be your problem. Check out the docs: Entity metadata wrappers.

  • Thank @leymannx I'm using the node object but still not seeing the fields I'm expecting. – BearWithNoHair Oct 10 '18 at 14:20

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.