I'm not sure if this is working as designed or not, but it does not seem likely. It is impossible to filter by block type in the views interface. Option does not appear in the list of filters, and the generated SQL simply filters by name ('bean') on the fields. I do not see the bundle.

Comments

nicksanta’s picture

I have also ran into this problem. Surely this is simply an oversight?

beanluc’s picture

I've experienced this too. I've so far worked around it by filtering against a field which is unique to the desired bean-type.

hazah’s picture

Category: feature » bug

Has anyone from the project's team read this? Asking because I do not see any evidence of acknowledgement after almost 2 months. Everyone is busy, of course, and there is nothing wrong with that. My concern is primarily with knowing whether or not to keep waiting for a resolution or to move on to something that works.

I'm changing it to a bug because it's obviously an intended feature. I say that because when you initially setup the view it actually GIVES you that option, but then cannot it read back when you're dropped into the main views interface.

beanluc’s picture

Version: 7.x-1.0-rc4 » 7.x-1.0-rc5
saltednut’s picture

Not to be terribly terse here, but if you're trying to use Views to display Beans then "you're probably doing it wrong."

Just explaining why this issue may not have had the love you'd expect to see.

I totally agree that it should still work - but I could see why it would not be near the top of anyones list of priorities.

hazah’s picture

I had 2 block types. One held an address field to be displayed across all pages. The other had an image field and each instance would be displayed according to custom criteria. The front page needed to consist of all the images as a slideshow. Beans seemed appropriate for this was all secondary content. Views seemed appropriate since views is a query builder. It made sense to collect the beans by type to generate a slideshow, alas, this simple task can only properly be achieved with nodes.

beanluc’s picture

if you're trying to use Views to display Beans then "you're probably doing it wrong."

Haha, that's pithy, but, as a blanket statement, it's only true for certain limited values of "it".

Consider replacing "Beans" in that statement with the name of any other entity type. Is Views wrong for Beans but right for all the others? Regarding the idea of "using Views to display [[nodes, users, taxonomy terms]]": Sometimes it's right and sometimes it's not.

I for one have several very compelling use-cases for this. Yeah, it would be doing "it" wrong if all someone is trying to do is, display one bean on one page.

I'll concede that using a different entity-type to collect the same per-instance field-data, and using a View to display it in a block, is one alternative to using a View to select and render a fielded block-entity. Or that solutions like Context might suit some sites better than Views. But those would frankly be wrong ways, for at least some of the solutions I've built.

hazah’s picture

Consider replacing "Beans" in that statement with the name of any other entity type.

My sentiment exactly. Thanks for the succinct wording.

indytechcook’s picture

Version: 7.x-1.0-rc5 » 7.x-1.x-dev
Category: bug » feature

Hey guys,

This sounds like a very useful feature. Currently all views support is via the Entity API module. Since beans does not turn the bean types into entity's themselves, there is no integration out of the box.

Being that I dont' use views on my sites anymore (see http://treehouseagency.com/blog/neil-hastings/2011/09/06/building-energy...) this is probably something I won't do but I would like to see this feature in the bean module.

But as always Patches are welcome!

hazah’s picture

Would the same method that works for nodes (without the entity api) be the right approach?

indytechcook’s picture

@hazah, yes, i would assume so.

hazah’s picture

Great. I've began to copy it.

saltednut’s picture

Consider replacing "Beans" in that statement with the name of any other entity type.

Fair enough - like I said, this SHOULD work.

barraponto’s picture

Status: Active » Needs review
StatusFileSize
new2.49 KB

I've basically copied over the stuff from node, and used Entity API for the options. Seems to be working for me (although I just rebased on top of origin/7.x-1.x so please test).

hazah’s picture

Gonna compare to my own work... I'm basically taking the same route. I wouldn't mind collaborating on it.

barraponto’s picture

@hazah I pinged someone on #drupal-contribute thinking I was pinging you, irc nickname is Haza`

Anyway, you should just publish your ongoing work as work-in-progress patches. I didn't want to write this from scratch, but I needed it so...

hazah’s picture

Hmm. not on IRC, though it's probably not a good thing to admit to :). I need to learn my patch making tools here.

indytechcook’s picture

Issue tags: +Release blocker

Still looking for more testers on this.

barraponto’s picture

hazah, can you test it?

hazah’s picture

Yeah I'll give it a shot. I'll ping back when I have results.

betz’s picture

Status: Needs review » Reviewed & tested by the community

Tested and this works perfect.
I can add a 'bean type' filter, and expose it.

indytechcook’s picture

Status: Reviewed & tested by the community » Fixed
barraponto’s picture

@indytechcook Can you start using git am to give me attribution for my patches? I already use git format-patch to make your life easier...

indytechcook’s picture

barraponto, i do give you author attribution for all of your patches using --author. dreditor gives me some short cuts for creating the commit messages which give you full credit for the commit.

barraponto’s picture

Sorry, i thought you weren't attributing since you seem not to use git am.
Thanks a lot :D

Status: Fixed » Closed (fixed)

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

core44’s picture

Ive been setting up a site that exports beans using an export view and I needed to have the bean type column available as both an argument and a field, so Ive created a simple patch that adds these additional handlers. Not sure how beneficial this is to others, but thought Id share the patch anyway.

core44’s picture

Updating the above patch to apply against 7.x-1.1. Now just adds argument handler for 'type'.