Closed (fixed)
Project:
Commerce Core
Version:
7.x-1.x-dev
Component:
User experience
Priority:
Normal
Category:
Task
Assigned:
Issue tags:
Reporter:
Created:
17 Jan 2011 at 10:18 UTC
Updated:
3 Jan 2014 at 02:41 UTC
Jump to comment: Most recent, Most recent file

Comments
Comment #1
Bojhan commented#1029654: Empty table messages
Comment #2
rszrama commentedTagging.
Comment #3
Bojhan commentedViews is now fixed, can we fix this?
Comment #4
bojanz commentedSure. This is an easy tweak.
Comment #5
bojanz commentedCompletely untested.
http://drupalcode.org/sandbox/bojanz/1097750.git/commit/f16ada1
Comment #6
bojanz commentedComment #7
rszrama commentedI don't think we need this option on every table (for example, the shopping cart shouldn't need it anywhere, and some Views don't have empty text like the line item table and Payment tab View). Additionally, the mock-up specified links to add missing items if applicable.
I'd just limit this to the three main Views for now: Customer profiles, Products, and Orders.
Comment #8
Bojhan commentedWhy is this not in yet?
Comment #9
rszrama commentedI guess because no one got around to fixing it. *Bump.* : D
Comment #10
mr.baileysPatch attached that switches to using table layout for the empty text for the Customer Profiles, Orders and Products-views.
I did not implement the "links to add missing items" mentioned in #7 and shown in the mock-up since:
Comment #11
mr.baileysHere's what it looks like for Customer Profiles with the patch from #10 applied:
Comment #12
bojanz commentedLooks good.
Comment #13
Bojhan commentedActually according to http://drupal.org/node/1146122 - it should always also have the "action" in this case Add a customer profile at the end of the empty message.
Comment #14
mr.baileysFair enough, here's a patch that includes the action links in the empty results text.
For now I've just switched to "Filtered HTML" since this is used by Commerce in a number of places. I'll open a separate issue to address the fact that "Filtered HTML" is not always available which might cause link-tags to show up escaped.
Comment #15
rszrama commentedNice, I don't think I was aware that Views could still use the table for the empty message.
mr.baileys is really rocking the queue lately! I smell a big Commerce project in the works over there... : )
Will leave this open for review later today.
Comment #16
rszrama commentedI'm not sure I want to commit this as is while it depends on relative URLs for the empty message text. The problem is Drupal may be used in a folder on the domain (which is the case for my development environment, for example), and using a relative URL beginning with a / will break these "add" links. This means we may actually have to implement area handlers for the empty text (if that's even possible). I'd be fine with the short term workaround of just committing the patch without the links until we have a solution for those, but I also suppose there isn't much reason to rush it in.
Comment #17
mr.baileysAh yes. People with clean URLs disabled will probably not like this solution either.
Comment #18
mr.baileysFirst exposure to writing handlers for the Views 3 API...
This patch creates 3 area handlers to display empty text for Products, Orders and Customer profiles.The screenshot from #14 remains valid, it's just the way that the text is generated that changed. Using a views handler does allow us to bypass the problem the the Filtered HTML format might not be available.
One thing to note is that ever since the exposed filters were added to filter by SKU/order number/customer name, the empty text message used is not longer correct. In all three cases it states that no entity of that type has been created yet, while in reality they might exist but be ignored because of the exposed filter. So I guess we need to tweak the actual text too?
Comment #19
mr.baileysLess low-hanging than I figured :)
Comment #20
rszrama commentedHmm, good call. Maybe we can just have the handler check to see if there are any filters on the View, and if so have it say something like "No products match your filter criteria." without including the add link.
Comment #21
rszrama commentedI went ahead and pushed this through to completion. First I moved all the area handlers to the base modules instead of the UI modules; they should really be available whether the site is using the default UI modules or not. To accommodate this, I added an option for the 'add_path' that will be used to generate the appropriate add link if specified. As I described above, I also check to see if there's any exposed filter input in the View, and if so I assume the View has been filtered and display an appropriate message instead of the default empty text message.
Commit: http://drupalcode.org/project/commerce.git/commitdiff/182bbcb
Comment #22.0
(not verified) commentedFixed broken image src-attribute