Timeline for Empty field collection in hook_node_presave with entity_metadata_wrapper
Current License: CC BY-SA 3.0
11 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Sep 6, 2016 at 20:43 | comment | added | diamondsea | @Clive was just saying that you can use "foreach ($ewrapper->field_field_collection as $delta => $fc_wrapper)" instead. You don't need ->getIterator(). | |
Sep 4, 2015 at 14:30 | vote | accept | masdzen | ||
Jun 22, 2015 at 9:07 | answer | added | masdzen | timeline score: 1 | |
Mar 6, 2015 at 13:24 | comment | added | masdzen | to calculate the amount of field collection item I hook_node_presave walk this way (using "foreach ($ewrapper->field_field_collection->getIterator() as $delta => $fc_wrapper)") the field collection and in the loop calculates the sum. at some point, after you upgrade modules field_collection or entity this approach stopped working.. perhaps it is something else, I want to know.. it should be noted that in other "places" (not hook_node_presave) this method works perfectly in this case, it turns out that in the object $node the data in field collection is, and when using wrapper access lost.. | |
Mar 6, 2015 at 12:01 | comment | added | Clive♦ |
It wasn't an answer, it was a comment asking you to clarify your choice to use getIterator()
|
|
Mar 6, 2015 at 11:55 | comment | added | masdzen | how do I bypass the "field collection" using your answer? "EntityListWrapper is iterrable, why the need for ->getIterator()?" | |
Mar 6, 2015 at 11:51 | comment | added | Clive♦ | I don't understand the question. If your question has changed, please click the "edit" link and update it that way | |
Mar 6, 2015 at 11:48 | comment | added | masdzen | how to use it ? | |
Feb 17, 2015 at 14:56 | comment | added | Clive♦ |
EntityListWrapper is iterrable, why the need for ->getIterator() ?
|
|
Feb 17, 2015 at 14:19 | history | edited | masdzen | CC BY-SA 3.0 |
added 1 character in body
|
Feb 17, 2015 at 6:54 | history | asked | masdzen | CC BY-SA 3.0 |