Closed (outdated)
Project:
Views Field View
Version:
7.x-1.x-dev
Component:
Miscellaneous
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
30 Mar 2016 at 23:29 UTC
Updated:
17 Mar 2026 at 17:09 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
joelpittetHere's a patch with that change, it seems pretty straight forward.
Comment #3
jibranSeems reasonable.
Comment #4
damiankloip commentedThis is purposely in the alter hook as we are adding to an existing table technically, not declaring a new one. That has been our general rule of thumb for views data. What's the use case for wanting to alter this?
Comment #5
joelpittet@damiankloip I needed to force one field to be clickable for a specific display (datatables).
Comment #6
damiankloip commentedClick sortable should actually be disabled, it is in the 8.x branch (did that in the port, just never got round to doing it in the 7.x branch). This is essentially a computed field, so how does click sorting even work?
Comment #7
joelpittetThere are a number of js libraries for sorting tables that avoid the Ajax and page loads if you have a fixed set of results.
The one I'm using specifically is https://www.drupal.org/project/datatables
Essentially allowing any column to be sortable on the js side.
Comment #8
damiankloip commentedAH ha, sorry. I totally missed you said datatables. Yes, I've used that a fair bit (not with views).
This is not a common case, so a hook_module_implements_alter() and a hook_views_data_alter() will work here. I kind of don't want to change this, but I see your problem now.
Comment #9
damiankloip commentedYou could also do something in an hook_preprocess_views_view_table() to add the label.
Comment #10
joelpittet@damiankloip I don't understand your point in #4 and why this doesn't seem as straight forward as allowing other modules to alter the definition provided by the "non-alter" hook. (in my mind the "definition" hook). Leaving the alter hook for the exceptions in which would need to alter.
Otherwise I'd need to write the hook_module_implements_alter to alter the order/weight of the alter hook executions which just feels wrong...
Comment #11
damiankloip commentedThe point is usually views_data is for declaring new tables and views_data_alter is for adding to/altering existing tables. Global is a special case but still a table.
Comment #12
damiankloip commentedAnyway, we can probably just do it. I just don't like the fact that we have to just so a hack can work 'cleanly' ;)
Comment #13
joelpittetClean hacks FTW!
Comment #14
tim.plunkettThe proposed approach is not architecturally pure, but it works and avoids
hook_module_implements_alter.RTBC from me.
Comment #15
vladimirausThank you for your contributions.
Drupal 7 is no longer supported.
Closing this issue as outdated.