Needs review
Project:
Views (for Drupal 7)
Version:
7.x-3.x-dev
Component:
Miscellaneous
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
12 Apr 2012 at 18:57 UTC
Updated:
16 Jan 2019 at 18:45 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
dawehnerDetecting whether a view is used somewhere else is really hard if not logically impossible.
Also your second suggestion is really hard because actually the other modules should react on that.
My suggestion would be here to warn the user, that renaming the machine_name can cause some problems. What do you think about that?
Comment #2
amfriedman commentedA warning is better than nothing, that's for sure! Given the fatal implications of such a rename -- panel panes being obliterated from the live site for instance -- I would highly recommend this is added in. An alert box perhaps, or simply a note beneath the field.
Also, part of what is so tricky about "knowing" where views are being used from other modules is the arbitrary way some modules' configuration data is saved in the database. In Panels in particular, panel/pane config data is simply jammed into a single field as a serialized array. This is problematic on many fronts, the least of which is that it is very difficult for any module to "know" what is in that array and to edit it programmatically without irreversibly screwing something up. This is precisely the reason why data belongs in a proper normalized database, so there is a structured why in which one reads and writes; not the brittleness of a serialized array.
Comment #3
dawehnerGive user advanced tools and they will destroy their sites :)
About the data storage: The main problem is that the schema of panels would have to be dynamic. You can't know at install time what kind of data a certain piece of information want to store. So to be able to do that you would need a lot of really complicated mess ... It's actually also possible to find that information out if you would use just exported objects, so you could use php to find that out, but as i wrote above, that's not trivial.
About the central problem, the data structure wouldn't probably help as well, because you would still not know where references to views are in ... anyway added a tag, let's see who will create a warning on that setting.
Comment #4
swarad07Have added a warning below the field description. Adding the patch for the same.
Cheers
Comment #5
dawehnerWhat about append this to the description and use spaces instead of tabs :)
Comment #6
swarad07Acknowledged !
I thought it was better to add it separately instead of adding it under description :)
Anyways, my eclipse completely screwed up the spacing. Attaching new patch.
Comment #7
dawehnerWe are currently in the stable phase of a contrib module, so we shouldn't break translations. What about adding a new t() function?
Comment #8
swarad07Something like this ? I have appended another t() to the existing one for #description.
Comment #9
dawehnerthis should be probably written small.
Comment #10
swarad07Silly me :-?
Comment #11
BeachsidePaul commentedAfter having spent a full day trying to override a view template file (views-view-unformatted.tpl.php) using the view's machine name, which had been changed, I stumbled on this issue. The theme information was suggesting the template be named with the new machine name but, unfortunately, this was not being picked up in the Drupal processing. The template file was being highlighted on the theme info display but it was NOT being used. Using one of the non-machine-name template names that were suggested worked right away of course. I really think that when a change is made to the machine name, the user should, at the very least, be warned of the possible ramifications.
Comment #12
swarad07Re-rolling the patch against latest 7.x-3.x.
Comment #13
chris matthews commentedThe 3 year old patch in #12 to views_plugin_display.inc applied cleanly to the latest views 7.x-3.x-dev and if still relevant needs to be reviewed.