Posted by damiankloip on August 26, 2012 at 9:45pm
8 followers
| Project: | Drupal core |
| Version: | 8.x-dev |
| Component: | views.module |
| Category: | task |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed (fixed) |
| Issue tags: | Configurables, Needs tests, VDC |
Issue Summary
*Maybe* it would make more sense to change the view 'name' property to 'id'?
Don't forget about views_entity_info.
Comments
#1
#2
#3
Let's see how this gets on now.
#4
#5
This seems to be a patch which should be postponed until nearly the end of API freeze.
#6
I don't mind, just thought it was a postponed one that could be got out the way pretty easily. This has to be changed and the api around getting the id with id() and storing it in yaml won't change much :)
#7
The last submitted patch, 1757564-id.patch, failed testing.
#8
#3: 1757564-id.patch queued for re-testing.
#9
The last submitted patch, 1757564-id.patch, failed testing.
#10
#3: 1757564-id.patch queued for re-testing.
#11
The last submitted patch, 1757564-id.patch, failed testing.
#12
Forgot to change the entity info in the annotation, it's always the small things.
#13
The last submitted patch, 1757564-12.patch, failed testing.
#14
Let's see how this gets on.
#15
The last submitted patch, 1757564-14.patch, failed testing.
#16
#14: 1757564-14.patch queued for re-testing.
#17
The last submitted patch, 1757564-14.patch, failed testing.
#18
#19
+++ b/core/modules/views/lib/Drupal/views/Plugin/Core/Entity/View.phpundefined@@ -165,7 +165,7 @@ public function uri() {
* Overrides Drupal\Core\Entity\EntityInterface::id().
*/
public function id() {
- return $this->get('name');
+ return $this->get('id');
We can remove this method now (which was part of the reason to switch)
+++ b/core/modules/views/lib/Drupal/views/Plugin/Core/Entity/View.phpundefined@@ -207,7 +207,7 @@ public function isEnabled() {
public function getHumanName() {
We should make a separate issue to make this just View::label()
+++ b/core/modules/views/lib/Drupal/views/Plugin/Core/Entity/View.phpundefined@@ -207,7 +207,7 @@ public function isEnabled() {
+ $human_name = $this->get('id');
Let's try to use id() directly
#20
Thanks Tim. Yeah, That must have been a missed ->get('id') there. Also removed the id() method.
#21
Created #1888390: [Change notice] Change 'human_name' to 'label' and replace View::getHumanName() with View::label()
#22
Let's fix the two most horrible lines in views.
Every other single line of the patch looked perfect!
#23
The last submitted patch, drupal-1757564-22.patch, failed testing.
#24
We just missed the cloning stuff exposed by the default views test.
#25
Great!
#26
#27
#24: 1757564-24.patch queued for re-testing.
#28
The last submitted patch, 1757564-24.patch, failed testing.
#29
Rerolled.
#30
The last submitted patch, vdc-1757564-29.patch, failed testing.
#31
re roll didn't have the super new views serializer support in :)
#32
There we go.
#33
Two times the exact same patch.
#34
Tagging, since this brings us in line with the other config entities.
#35
Yay for moar consistency.
Committed and pushed to 8.x. Thanks!
This'll need a tiny change notice.
#36
The change notice: http://drupal.org/node/1893002
#37
Change notice:
- $view_name = $view->name;+ $view_name = $view->storage->id();
Patch:
+++ b/core/modules/views/lib/Drupal/views/Plugin/Core/Entity/View.php@@ -48,11 +48,11 @@ class View extends ConfigEntityBase implements ViewStorageInterface {
/**
- * The name of the view.
+ * The unique ID of the view.
*
* @var string
*/
- public $name = NULL;
+ public $id = NULL;
Can we now use $view->id() instead?
#38
+++ b/core/modules/views/includes/ajax.inc@@ -208,7 +208,7 @@ function views_ajax_command_replace_title($title) {
- 'siteName' => config('system.site')->get('name'),
+ 'siteName' => config('system.site')->id(),
+++ b/core/modules/views/views.theme.inc@@ -877,7 +877,7 @@ function template_preprocess_views_view_rss(&$vars) {
if ($view->display_handler->getOption('sitename_title')) {
- $title = $config->get('name');
+ $title = $config->id();
if ($slogan = $config->get('slogan')) {
$title .= ' - ' . $slogan;
Oops.
EDIT: The first one was already fixed in #1896990: Cannot edit a View's title from the UI.
#39
There we go.
#40
Looks good to me and /rss.xml works again.
#41
Why did tests not break?
#42
Should this be moved into a follow up? Otherwise we have a change notice issue that needs tests, that's weird.
#43
Yeah webchick is totally right there are certain pieces of code which does not have test coverage yet.
Working on the follw up: #1903410: Wrong config key is used in template_preprocess_views_view_rss
#44
So we can mark this as fixed, as we have a bugfix for the patch.
#45
Automatically closed -- issue fixed for 2 weeks with no activity.
#46
Updating title and tags now that we have a change notice.