Comments

damiankloip’s picture

Status: Active » Postponed
xjm’s picture

Project: Views (for Drupal 7) » Drupal core
Version: 8.x-3.x-dev » 8.x-dev
Component: Code » views.module
damiankloip’s picture

StatusFileSize
new48.42 KB

Let's see how this gets on now.

damiankloip’s picture

Status: Postponed » Needs review
dawehner’s picture

This seems to be a patch which should be postponed until nearly the end of API freeze.

damiankloip’s picture

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 :)

Status: Needs review » Needs work
Issue tags: -VDC

The last submitted patch, 1757564-id.patch, failed testing.

tim.plunkett’s picture

Status: Needs work » Needs review

#3: 1757564-id.patch queued for re-testing.

Status: Needs review » Needs work

The last submitted patch, 1757564-id.patch, failed testing.

tim.plunkett’s picture

Status: Needs work » Needs review

#3: 1757564-id.patch queued for re-testing.

Status: Needs review » Needs work
Issue tags: +VDC

The last submitted patch, 1757564-id.patch, failed testing.

damiankloip’s picture

Status: Needs work » Needs review
StatusFileSize
new48.62 KB

Forgot to change the entity info in the annotation, it's always the small things.

Status: Needs review » Needs work

The last submitted patch, 1757564-12.patch, failed testing.

damiankloip’s picture

Status: Needs work » Needs review
StatusFileSize
new106.84 KB

Let's see how this gets on.

Status: Needs review » Needs work
Issue tags: -VDC

The last submitted patch, 1757564-14.patch, failed testing.

damiankloip’s picture

Status: Needs work » Needs review

#14: 1757564-14.patch queued for re-testing.

Status: Needs review » Needs work
Issue tags: +VDC

The last submitted patch, 1757564-14.patch, failed testing.

damiankloip’s picture

Status: Needs work » Needs review
StatusFileSize
new132.28 KB
tim.plunkett’s picture

+++ 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

damiankloip’s picture

StatusFileSize
new887 bytes
new132.38 KB

Thanks Tim. Yeah, That must have been a missed ->get('id') there. Also removed the id() method.

dawehner’s picture

StatusFileSize
new132.96 KB
new1.21 KB

Let's fix the two most horrible lines in views.

Every other single line of the patch looked perfect!

Status: Needs review » Needs work

The last submitted patch, drupal-1757564-22.patch, failed testing.

damiankloip’s picture

Status: Needs work » Needs review
StatusFileSize
new2.04 KB
new135 KB

We just missed the cloning stuff exposed by the default views test.

dawehner’s picture

Status: Needs review » Reviewed & tested by the community

Great!

tim.plunkett’s picture

Title: Change 'name' to 'id' on config/ViewStorage » Change 'name' to 'id' on View entity
catch’s picture

Issue tags: -VDC

#24: 1757564-24.patch queued for re-testing.

Status: Reviewed & tested by the community » Needs work
Issue tags: +VDC

The last submitted patch, 1757564-24.patch, failed testing.

tim.plunkett’s picture

Status: Needs work » Needs review
StatusFileSize
new135.01 KB

Rerolled.

Status: Needs review » Needs work

The last submitted patch, vdc-1757564-29.patch, failed testing.

damiankloip’s picture

Status: Needs work » Needs review
StatusFileSize
new1.3 KB
new136.31 KB

re roll didn't have the super new views serializer support in :)

dawehner’s picture

StatusFileSize
new136.31 KB

There we go.

dawehner’s picture

Status: Needs review » Reviewed & tested by the community

Two times the exact same patch.

tim.plunkett’s picture

Issue tags: +Configurables

Tagging, since this brings us in line with the other config entities.

webchick’s picture

Title: Change 'name' to 'id' on View entity » Change notice: Change 'name' to 'id' on View entity
Status: Reviewed & tested by the community » Active
Issue tags: +Needs change record

Yay for moar consistency.

Committed and pushed to 8.x. Thanks!

This'll need a tiny change notice.

dawehner’s picture

olli’s picture

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?

olli’s picture

Status: Active » Needs work
+++ 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.

dawehner’s picture

Status: Needs work » Needs review
StatusFileSize
new581 bytes

There we go.

olli’s picture

Status: Needs review » Reviewed & tested by the community

Looks good to me and /rss.xml works again.

webchick’s picture

Status: Reviewed & tested by the community » Needs work
Issue tags: +Needs tests

Why did tests not break?

damiankloip’s picture

Should this be moved into a follow up? Otherwise we have a change notice issue that needs tests, that's weird.

dawehner’s picture

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

dawehner’s picture

Status: Needs work » Fixed

So we can mark this as fixed, as we have a bugfix for the patch.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

star-szr’s picture

Title: Change notice: Change 'name' to 'id' on View entity » Change 'name' to 'id' on View entity
Issue tags: -Needs change record

Updating title and tags now that we have a change notice.

star-szr’s picture

Issue summary: View changes

.