Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Status: Needs review » Needs work

The last submitted patch, locale.patch, failed testing.

dawehner’s picture

Status: Needs work » Needs review
FileSize
14.26 KB

Wow the schema of locale really changed a lot since the last time someone had a look at it.

Should we actually also apply the full codestyles to new/reintroduced files?

The handlers all patch is simply great as it automatically tests that you don't have fields which aren't in the database anymore.

aspilicious’s picture

Status: Needs review » Needs work
+++ b/core/modules/locale/lib/Drupal/locale/Plugin/views/field/LinkEdit.phpundefined
@@ -0,0 +1,77 @@
+  protected function defineOptions() {

All those functions need a docblock. Something like "Overrides ..." or "Implements ..."

+++ b/core/modules/locale/lib/Drupal/locale/Plugin/views/filter/Version.phpundefined
@@ -0,0 +1,42 @@
+  function get_value_options() {

Same

A basic view that uses this intgeration would increase our test coverage a lot.

dawehner’s picture

FileSize
2.47 KB
14.77 KB

This just fixes the comments, we didn't came to a good conclusion regarding the test coverage, but i agree at least the custom handlers should be tested.

jibran’s picture

Status: Needs work » Needs review
FileSize
2.68 KB
14.34 KB

Reroll. Do we need test for this?

Status: Needs review » Needs work

The last submitted patch, 1853534-5.patch, failed testing.

jibran’s picture

Status: Needs work » Needs review
FileSize
1.61 KB
14.35 KB

Did you maybe forget to add a "use" statement for this annotation? Yes

dawehner’s picture

Thanks for taking this up!!!!

+++ b/core/modules/locale/lib/Drupal/locale/Plugin/views/field/LinkEdit.phpundefined
@@ -0,0 +1,89 @@
+ * Definition of Drupal\locale\Plugin\views\field\LinkEdit.

+++ b/core/modules/locale/lib/Drupal/locale/Plugin/views/filter/Version.phpundefined
@@ -0,0 +1,42 @@
+ * Definition of Drupal\locale\Plugin\views\filter\Version.

Should be Contains ...

+++ b/core/modules/locale/lib/Drupal/locale/Plugin/views/field/LinkEdit.phpundefined
@@ -0,0 +1,89 @@
+  protected function defineOptions() {

Needs an @inheritdoc

+++ b/core/modules/locale/lib/Drupal/locale/Plugin/views/filter/Version.phpundefined
@@ -0,0 +1,42 @@
+      $result = db_query('SELECT DISTINCT(version) FROM {locales_source} ORDER BY version');

You could also inject the database connection into the handler.

+++ b/core/modules/locale/locale.views.incundefined
@@ -0,0 +1,455 @@
+ * Provides views data and handlers for locale.module.

It doesn't provide handlers anymore.

+++ b/core/modules/locale/locale.views.incundefined
@@ -0,0 +1,455 @@
+  // Basic table information.
...
+  // Define the base group of this table.
...
+  // Advertise this table as a possible base table.
...
+  // lid
...
+  // Source field
...
+  // Context field
...
+  // Version field
...
+  // Locales target table
...
+  // Define the base group of this table. Fields that don't
+  // have a group defined will go into this field by default.
...
+  // Join information
...
+  // Translation field
...
+  // Language field
...
+  // Plural

Let's drop all this pointless comments.

+++ b/core/modules/locale/locale.views.incundefined
@@ -0,0 +1,455 @@
+      'click sortable' => TRUE,
...
+      'click sortable' => TRUE,
...
+      'click sortable' => TRUE,
...
+      'click sortable' => TRUE,
...
+      'click sortable' => TRUE,
...
+      'click sortable' => TRUE,
...
+      'click sortable' => TRUE,
...
+      'click sortable' => TRUE,
...
+      'click sortable' => TRUE,
...
+      'click sortable' => TRUE,
...
+      'click sortable' => TRUE,
...
+      'click sortable' => TRUE,
...
+      'click sortable' => TRUE,
...
+      'click sortable' => TRUE,
...
+      'click sortable' => TRUE,

With drupal 8 all this is click sortable by default, so we can remove those.

Status: Needs review » Needs work

The last submitted patch, 1853534-7.patch, failed testing.

jibran’s picture

Status: Needs work » Needs review
FileSize
14.79 KB
10.03 KB

Thanks @dawehner for the great review. Fixed all #8 and failure in #7.

dawehner’s picture

Sadly the current version of the test does not contain any kind of test :(

jibran’s picture

Status: Needs review » Needs work
Issue tags: +Needs tests
xjm’s picture

Issue summary: View changes
Issue tags: +beta target
xjm’s picture

Priority: Normal » Major
xjm’s picture

Issue tags: +D8MI
Gábor Hojtsy’s picture

Issue tags: +language-ui

@jibran pinged me about this in IRC. I think this would still be great to include for custom admin pages. However the locale tables changed significantly since then, so the code would need to be updated significantly.

  1. +++ b/core/modules/locale/lib/Drupal/locale/Plugin/views/field/LinkEdit.php
    @@ -0,0 +1,93 @@
    +    $options['text'] = array('default' => '', 'translatable' => TRUE);
    

    What does translatable mean here?

  2. +++ b/core/modules/locale/locale.views.inc
    @@ -0,0 +1,425 @@
    +    'help' => t('A source string for translation, in English or the default site language.'),
    

    Should only be English in Drupal 8. Non-English sources are never maintained in locale, at least definitely not by core and not intended for contrib either.

  3. +++ b/core/modules/locale/locale.views.inc
    @@ -0,0 +1,425 @@
    +    'help' => t('The release version of the project.'),
    

    Not true. This is the last version the string was used with. See locale.install for a more accurate description.

  4. +++ b/core/modules/locale/locale.views.inc
    @@ -0,0 +1,425 @@
    +  $data['locales_target']['plid'] = array(
    +    'title' => t('Singular LID'),
    +    'help' => t('The ID of the parent translation.'),
    +    'field' => array(
    +      'id' => 'standard',
    +    ),
    +  );
    +
    +  $data['locales_target']['plural'] = array(
    +    'title' => t('Plural'),
    +    'help' => t('Whether or not the translation is plural.'),
    

    These columns do not exist anymore, however there is a "Customized" column which would be important to expose.

  5. +++ b/core/modules/locale/locale.views.inc
    @@ -0,0 +1,425 @@
    +  $data['locales_location']['table']['join'] = array(
    +    'locales_source' => array(
    +      'left_field' => 'sid',
    +      'field' => 'lid',
    +    ),
    +    'locales_target' => array(
    +      'left_field' => 'lid',
    +      'field' => 'lid',
    

    What's sid in locales_location is lid in both locales_source and locales_target. (I know the DB should have been cleaned up, but we did not get around to that). It is 100% sure that joining from lid to lid will not be good because they mean different things in the two tables.

  6. +++ b/core/modules/locale/locale.views.inc
    @@ -0,0 +1,425 @@
    +  $data['locale_file']['table']['group'] = t('Locale group');
    

    Locale file instead of group IMHO.

    Also lots of columns missing from this integration (project, version, last_checked).

  7. +++ b/core/modules/locale/locale.views.inc
    @@ -0,0 +1,425 @@
    +  $data['locale_project']['table']['group'] = t('Locale project');
    +
    +  $data['locale_project']['table']['base'] = array(
    +    'field' => 'name',
    +    'title' => t('Locale project'),
    +  );
    

    Seems to be a nonexistent table at this point. Most columns integrated to locale_file, see above.

  8. +++ b/core/modules/locale/locale.views.inc
    @@ -0,0 +1,425 @@
    +function locale_views_project_types() {
    

    Don't think this one is needed either given the above notes about the table being removed.

Also definitely needs a test view or two.

xjm’s picture

Version: 8.0.x-dev » 8.2.x-dev
Issue tags: -beta target

This issue was marked as a beta target for the 8.0.x beta, but is not applicable as an 8.1.x beta target, so untagging.

As a feature addition, it should be targeted for 8.2.x at this point.

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.0-beta1 was released on August 3, 2016, which means new developments and disruptive changes should now be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.0-alpha1 will be released the week of January 30, 2017, which means new developments and disruptive changes should now be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.0-alpha1 will be released the week of July 31, 2017, which means new developments and disruptive changes should now be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.0-alpha1 will be released the week of January 17, 2018, which means new developments and disruptive changes should now be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.6.x-dev » 8.7.x-dev

Drupal 8.6.0-alpha1 will be released the week of July 16, 2018, which means new developments and disruptive changes should now be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.7.x-dev » 8.8.x-dev

Drupal 8.7.0-alpha1 will be released the week of March 11, 2019, which means new developments and disruptive changes should now be targeted against the 8.8.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.0-alpha1 will be released the week of October 14th, 2019, which means new developments and disruptive changes should now be targeted against the 8.9.x-dev branch. (Any changes to 8.9.x will also be committed to 9.0.x in preparation for Drupal 9’s release, but some changes like significant feature additions will be deferred to 9.1.x.). For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.9.x-dev » 9.1.x-dev

Drupal 8.9.0-beta1 was released on March 20, 2020. 8.9.x is the final, long-term support (LTS) minor release of Drupal 8, which means new developments and disruptive changes should now be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 9.1.x-dev » 9.2.x-dev

Drupal 9.1.0-alpha1 will be released the week of October 19, 2020, which means new developments and disruptive changes should now be targeted for the 9.2.x-dev branch. For more information see the Drupal 9 minor version schedule and the Allowed changes during the Drupal 9 release cycle.

Version: 9.2.x-dev » 9.3.x-dev

Drupal 9.2.0-alpha1 will be released the week of May 3, 2021, which means new developments and disruptive changes should now be targeted for the 9.3.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.0-rc1 was released on November 26, 2021, which means new developments and disruptive changes should now be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.0-alpha1 was released on May 6, 2022, which means new developments and disruptive changes should now be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.5.x-dev » 10.1.x-dev

Drupal 9.5.0-beta2 and Drupal 10.0.0-beta2 were released on September 29, 2022, which means new developments and disruptive changes should now be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 10.1.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch, which currently accepts only minor-version allowed changes. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Lendude’s picture

Issue tags: +ddd2023

Discussed with @Gábor Hojtsy at ddd23, we agreed, this is still worth adding.