0

Trying to populate select list in VBO action form (basically could be anyform) and using enityfieldquery to get list. By this methods $result object contains node arrays.

Can this array can be loaded into select list directly? or we need to apply node_load_multiple on $results array.

Reason why I am asking is, there are many field and for the select list, only title and nid is enough right?

Are there any workaround for this?

1 Answer 1

1

Can this array can be loaded into select list directly? or we need to apply node_load_multiple on $results array.

A FAPI select list expects an Array with id and title. An entityfieldquery returns only a list of IDs unless you get creative. Typically you perform extra work to load fields you want to show as text in your select field. You can do this via SQL, node_load a view resultset ... whatever means you're comfortable with.

EDIT

Well I didnt say you have to use node load. There are various extensions to EFQ that let you use community created EFQ classes:

2
  • ok got it, only entityfieldquery is not enough :(. > extra work to load fields . thats what I am afraid of using node_load_multiple with lot of fields and it is not necessary for select list at all.
    – kiranking
    Commented Mar 10, 2015 at 20:23
  • please see my edit.
    – tenken
    Commented Mar 10, 2015 at 21:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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