Closed (duplicate)
Project:
Views (for Drupal 7)
Version:
8.x-3.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
23 Aug 2012 at 15:47 UTC
Updated:
21 Jan 2013 at 20:58 UTC
Jump to comment: Most recent file
Comments
Comment #1
dawehnerThe plan is to use the logic in the cache plugins to find all the changed css/js put it into the global view object
and use it on to return a really simple render-array with #attached on it.
The problem with this though it that you need to use a cache plugin
even you actually don't use one because the block cache is active.
So maybe we should better move the logic into the display/view or create a stub cache-plugin.
Comment #2
tim.plunkettComment #3
bellesmanieres commentedPatch attached, retrieves css and js from cache plugin, and add them as #attached to the block content.
Comment #4
dawehnerThe cache is stored as a static cache on the display, so this code really gives you the information needed, just checked that.
I'm wondering whether this code can be simplified by get something more usefull from the cache plugin.
Comment #5
bellesmanieres commentedOnly thing I can see in term of simplification is avoiding the unnecessary iteration on files elements for js, as per attached patch.
One other solution could probably be to refactor CachePluginBase to set the $storage (and get_cache/set_cache) using an array(data, type) style, but seems quite an overhead as only settings won't be default "files" type.
Any other idea ?
Comment #6
dawehnerAs this will break some other patches please try to stay in the scope of the issue.
Comment #7
tim.plunkettSo what code is that actually replacing? Shouldn't there be deleted lines wherever it was added without #attached?
This all looks unrelated. Good stuff for another issue though.
Comment #8
bellesmanieres commentedRemoved the "noise", hadn't spotted this had went in, sorry. Deleted code is only one line, as css/js were not added there at all prior to this.
Comment #9
aspilicious commented#8: 1748164-use_attached_for_block_js_css-8.patch queued for re-testing.
Comment #11
tim.plunkettThe file moved, and s/get_plugin/getPlugin/
Comment #13
moshe weitzman commentedLooks like modern work is at #1811828: Use #attached to find the css/js of a view
Comment #14
dawehnerI think it would help to backport.
Comment #15
tim.plunkettDave opened a new issue: #1894736: Cannot use #attached to add general CSS/JS/Library to a View
Lets just let this one die.