Closed (fixed)
Project:
Bean (for Drupal 7)
Version:
7.x-1.x-dev
Component:
User interface
Priority:
Normal
Category:
Feature request
Assigned:
Reporter:
Created:
20 Jun 2012 at 16:47 UTC
Updated:
26 Jul 2012 at 15:21 UTC
Jump to comment: Most recent file
Comments
Comment #1
Guito339 commentedPlease find patch attached.
Comment #2
Guito339 commentedComment #3
fmitchell commentedAssigning to me to review.
Comment #4
indytechcook commentedThis is a neat idea but I think I'd rather see this at admin/reports/bean-usage that way it corresponds with other usage type reports.
Comment #5
fmitchell commentedAgreed.
It'd also be nice if when viewing a bean, we utilized the functions generating the report to show a list of linked nodes that reference it. I believe this was also part of the original intention of the request.
Gui, can you add those two changes?
1.) Put the callback under reports
2.) Provide an additional list of linked nodes on the bean view to show where it is being used as a blockreference so a user could jump to that node right away.
Comment #6
Guito339 commentedI changed the link to admin/reports/bean/usage just in case we come up with something else to add under bean reports. I also added a permission for view bean usage as a user should not need to have 'administer beans' to view the usage report.
Comment #7
Guito339 commentedHere is another patch with a 'Usage' tab on the bean view to see where the bean in being used with drill down links.
Comment #8
mrfelton commentedCan we get a screenshot?
Comment #9
skwashd commentedI had a quick look over this code and it seems to assume that everyone using BEAN will be using blockreference.module. The hook_menu implementation and other places that implement blockreference specific functionality need to be wrapped in
if (module_exists('blockreference')) { ... }blocks to avoid introducing a hard dependency for the module.Comment #10
Guito339 commentedscreenshots attached as per usage on Department of Energy.
Comment #11
Guito339 commentedI wrapped the hook_menu_items content in an if (module_exists('blockreference)) { ... } in the latest patch (bean_usage_view-1649312-6164156.patch). This way the usage tab and report links will not display unless the blockreference module is installed and enabled.
Comment #12
fmitchell commentedThe patch from #11 didn't apply cleanly to me. It looks like it might have been diff'd from an older version of bean.
The attached patch has been diff'd from the latest 7.x-1.x-dev.
I've put the usage into a separate module so we can easily add context and block admin usage later. This also makes it easier to add the blockreferences dependency.
I also pulled some (not all) of the queries out.
A couple of things for Guito339 to add just to /admin/reports/bean/usage callback, please:
It may be easier to make the report a view as this will accomplish all of the above, but you'll then have to refactor your code to be a views handler. If it's a default view, this would also allow users to add other fields as they see fit. It's up to you.
Comment #13
fmitchell commentedForgot patch
Comment #14
Guito339 commentedThe latest attachment off of 7.x-1.x has the sortable table headers, pagination, a form to set the number of results per page on the bean usage view and the added Bean title in between the label and entity id.
I am working on the filter next.
Comment #15
Guito339 commentedAttached is the next patch that includes all the table sorting, pagination, settings form and now the bean filter form. Please take a look and let me know if there is anything else that you'd like to see improved.
I did as much QA as I could, but having been working on this for a little over a week I might have missed something, so please QA as much as you can as well.
Comment #16
Guito339 commentedSorry guys! Patched from the wrong folder. Attached is the correct patch.
Comment #17
Guito339 commentedFound a small issue with the usage view for the individual bean. fmitchell also found an issue when adding a new bean, where the bean wasn't showing up. I found an issue in the query and fixed it. All should be well now. Patch attached. Please review
Comment #18
fmitchell commentedI applied the patch on a vanilla install. Received a few errors:
Once these are cleaned up, should be fine.
Comment #19
Guito339 commentedI added the code to a vanilla install and fixed the notices and warnings.
Patch attached, please test and verify.
Comment #20
fmitchell commentedLooks good. Pulled in.
http://drupalcode.org/project/bean.git/commit/d34eb7d