I have a fairly simple content View using VBO that works fine when executed from its page display, but fails when executed from the shell via Drush. The View uses VBO to execute a simple Rule (which employs Conditional Rules, though this isn't necessary for the failure). For this example, I've arranged for one item to be returned by the View, and the Drush command behaves as follows:


$ drush vbo-execute set_plant_image_tags rules_component::rules_set_plant_image_tags
Queing items for "Set plant image tags"  [ok]
Page with index: "0" was enqueued.  [ok]
Queued 1 item for "Set plant image tags"  [ok]
array_flip(): Can only flip STRING and INTEGER values! entity.inc:175  [warning]
array_flip(): Can only flip STRING and INTEGER values! entity.inc:388  [warning]
Processed 1 out of 1  [ok]
Performed "Set plant image tags" on 1 item.  [ok]

While VBO says that the action was performed, it actually wasn't, presumably due to the array_flip() warnings. The same operation from the UI works as expected.

I've attached exports of both the View and the Rule. Anyone know what's causing this failure, and how to fix or work around it?

Comments

jerry created an issue. See original summary.

joelpittet’s picture

Status: Active » Postponed (maintainer needs more info)

Can you provide me with a feature export of your content type because I can't seem to create 'plant' with the nessasary fields for that view to work.

Also, which version of entity api are you using?

jerry’s picture

Status: Postponed (maintainer needs more info) » Active
StatusFileSize
new10.54 KB

Can you provide me with a feature export of your content type because I can't
seem to create 'plant' with the nessasary fields for that view to work.

Attached. Apologies for the size; it's used with Feeds and has rather a lot of fields.

Also, which version of entity api are you using?

7.x-1.8

Thanks for taking a look at this.

joelpittet’s picture

This looks like it has a bunch of dependencies which all could be the culprit... can you tell me the versions of flexslider, file_entity. I have a broken handler in the view so need to sort that out

jerry’s picture

Flex Slider 7.x-2.0-rc1+21-dev (2016-Aug-05)
File Entity (fieldable files) 7.x-2.0-beta3
Media 7.x-2.0-rc3

joelpittet’s picture

This handler on the view seems to be broken, I'm not sure why, maybe you can tell me? Could need a different dependency?

test

jerry’s picture

Should be the same as the alt text filter, but title text instead - i.e. "(File) File: Title Text (empty)"

joelpittet’s picture

This is what it's showing me
test

jerry’s picture

StatusFileSize
new23.59 KB

This is what it should be:

views filter

joelpittet’s picture

Not sure what I'm doing wrong, deleted and recreated the plant type and this is the import on the view failure to validate:

test

jerry’s picture

StatusFileSize
new61.32 KB

If you look at the image file entity type fields, is field_file_image_title_text present?

flle fields

I believe that it's supposed to be there by default, along with field_file_image_alt_text, for images only. So far as I know, File Entity provides that, though I suppose it's possible that Media is also involved.

joelpittet’s picture

Yes field_file_image_title_text is there.

jerry’s picture

Dunno why the import isn't working, but perhaps you can just delete/re-create that filter. It's exactly like the alt text filter (checks for empty).

joelpittet’s picture

Found it, I tried creating that field as an image before I installed the file_entity and it used that base field for the Image entity type.

joelpittet’s picture

Somehow the rule export is no longer on this issue, can you re-attache both the view and the rule export please?

jerry’s picture

Click "Show 3 more files" at the bottom right of the file information list to see them.

joelpittet’s picture

Whoa, I thought they were gone, usually that is up in the Issue Summary. Thanks.

joelpittet’s picture

Just an FYI, you may want to set the max length of your botanical and common name to be less combined + the 3 characters than the title and alt fields or make those fields bigger because I ran into issues with the generated text fataling to store that large of values.

Also, mutliple values can be set on one field instead of field_1, field_2 etc.

Still on this

joelpittet’s picture

Status: Active » Needs review
StatusFileSize
new580 bytes

Ok try this patch, took a bit to track down as usual...

jerry’s picture

Good catch on the combined field name length; thanks.

Your patch is working fine for me. It eliminated the warnings and properly updated the file ALT tag field. Thanks for taking the time to chase it down; much appreciated!

  • joelpittet committed c9bdae8 on 7.x-3.x
    Issue #2846885 by joelpittet, jerry: VBO operation fails via Drush,...
joelpittet’s picture

Status: Needs review » Fixed

Thanks @jerry for the help tracking this down. I've committed and pushed it to -dev.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.