The new language admin table in language.module now lets modules inject data into it. Locale module injects a column in the language table to display translation status for different languages. The plan is that node module would inject information to this table as well as node translation would eject later to help manage content by language, just like the table now helps manage interface text by language.

(I think having this information from node module is the first step, then later from translation module, if that is enabled too, so from node module, it would just be a number of nodes in that language with a similar link).

Comments

gábor hojtsy’s picture

Issue tags: +D8MI, +sprint, +language-content

Add missing tags.

floretan’s picture

Assigned: Unassigned » floretan

Assigning to myself. I'll work on this tomorrow at the code sprint.

floretan’s picture

Status: Active » Needs review
StatusFileSize
new1.8 KB
new34.46 KB

Here's a patch and a screenshot of the result.

Note that the node count only includes nodes of types that can have a language.

Injecting node translation data should probably be done in a separate issue.

gábor hojtsy’s picture

As per live discussion:

- item => post
- make links work to actually limit to language

gábor hojtsy’s picture

Status: Needs review » Needs work
floretan’s picture

Status: Needs work » Needs review
StatusFileSize
new2.36 KB

Updated patch:

- "Item" replaced with "post"
- "language" parameter added to the link to the content overview page. Making that form accept $_GET parameters opens a whole bunch of issues due to it's twisted use of session variables though, so this should be done in a separate issue.

floretan’s picture

StatusFileSize
new1.76 KB

Didn't mean to include the part regarding node.admin.inc. Thanks to attiks for pointing this out.

Status: Needs review » Needs work

The last submitted patch, nodes_language_table-1632222-5.patch, failed testing.

artusamak’s picture

Assigned: floretan » artusamak

Having a look at the test failures. Adding an additional check if no content types are translatable.

floretan’s picture

Status: Needs work » Needs review
StatusFileSize
new1.91 KB

Thanks Artusamak. Here's an updated patch that only inserts the additional column if at least one content type can be translated.

artusamak’s picture

Working great for me!

artusamak’s picture

Assigned: artusamak » Unassigned
gábor hojtsy’s picture

Issue tags: +Needs tests

Still needs tests.

gábor hojtsy’s picture

Status: Needs review » Needs work
artusamak’s picture

Assigned: Unassigned » artusamak

On it!

artusamak’s picture

Assigned: artusamak » Unassigned
Status: Needs work » Needs review
StatusFileSize
new4.74 KB

Here is a test to check that the language overview table is displaying the posts count per language when available.

webflo’s picture

Status: Needs review » Needs work

Looks good. Only a few minors.

+++ b/core/modules/language/lib/Drupal/language/Tests/LanguageNodeStatsTest.phpundefined
@@ -0,0 +1,76 @@
+    // Setup users.

Its only one user.

+++ b/core/modules/node/node.moduleundefined
@@ -3949,3 +3949,49 @@ function node_language_delete($language) {
+/**
+ * Implements hook_form_FORM_ID_alter() for language_admin_overview_form().
+ */

We dont do 'for ...'. Use @see language_admin_overview_form().

+++ b/core/modules/node/node.moduleundefined
@@ -3949,3 +3949,49 @@ function node_language_delete($language) {
+  $info = entity_get_info('node');
+  foreach ($info['bundles'] as $machine_name => $bundle) {

node_type_get_types() is easier.

webflo’s picture

Issue tags: -Needs tests, -sprint +d7uxsprint

Removed 'Needs tests' tag.

webflo’s picture

Issue tags: -d7uxsprint +sprint

Added sprint.

jepster_’s picture

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

I've applyed the patch from #16 but I cannot find the test "Node language statistics" at admin/config/development/testing.

artusamak’s picture

StatusFileSize
new4.71 KB

Listed issues fixed.
@jepSter the group for the test was wrong, it's normally fixed.

jepster_’s picture

StatusFileSize
new0 bytes

After I get a fresh copy of drupal 8 files, patch drupal 8 with your file from #21 and choose your test "Node language statistics" at admin/config/development/testing/ and start the testing, I get 32 passes, 7 fails, 0 exceptions, and 10 debug messages.

the following is failing:

  • For example the following fails:
  • Failed to set field node_type_language to 1
  • Found the requested form fields at admin/structure/types/manage/page
  • Total of posts per language is displayed.
  • Failed to set field langcode to en
  • Found the requested form fields at node/add/page
  • Basic page created.
  • English displays one post.
gábor hojtsy’s picture

Status: Needs review » Needs work

Node type language setup code changed since the patch was rolled, that is the reason.

gábor hojtsy’s picture

Status: Needs work » Needs review
Issue tags: -Needs tests, -D8MI, -sprint, -language-content

Status: Needs review » Needs work
Issue tags: +Needs tests, +D8MI, +sprint, +language-content

The last submitted patch, nodes_language_table-1632222-21.patch, failed testing.

artusamak’s picture

Status: Needs work » Needs review
StatusFileSize
new4.8 KB

Here is an update of the test and the form alter.
Since the content type language changed, i'm listing the posts for every language (even special ones).
I removed the link if there is no post and removed the t() calls from the messages to be compliant with http://drupal.org/simpletest-tutorial-drupal7#t

gábor hojtsy’s picture

Issue tags: -sprint

This is a nice to have and have been called out for possible performance problems. Moving off of the sprint in the intrest of focusing people on the important stuff.

jair’s picture

Issue tags: +Needs reroll

Needs reroll

nitesh sethia’s picture

Assigned: Unassigned » nitesh sethia
StatusFileSize
new4.8 KB

Rerolling the patch #26

The last submitted patch, nodes_language_table-1632222-29.patch, failed testing.

Anonymous’s picture

Issue summary: View changes

Add one more note and image

alansaviolobo’s picture

Issue summary: View changes
Status: Needs work » Needs review
StatusFileSize
new1.51 KB
new4.61 KB

rerolled the patch.

Status: Needs review » Needs work

The last submitted patch, 31: make_node_module_inject-1632222-1.patch, failed testing.

xen’s picture

Status: Needs work » Needs review
Issue tags: -Needs tests, -Needs reroll
StatusFileSize
new4.73 KB
new5.99 KB

The langcode field have moved from the node table to the node_revision table.

Also moved the test file to PSR-4 location, and fixed the test to pass.

xen’s picture

Assigned: nitesh sethia » Unassigned

Unassigning.

xen’s picture

Issue tags: +Needs tests

The test is inadequate in my opinion. It basically just tests that the text changes when adding a new node, not that the code actually counts the number of nodes in each language.

Extending the test by adding another language and checking that each language count is correct should do it.

Version: 8.0.x-dev » 8.1.x-dev

Drupal 8.0.6 was released on April 6 and is the final bugfix release for the Drupal 8.0.x series. Drupal 8.0.x will not receive any further development aside from security fixes. Drupal 8.1.0-rc1 is now available and sites should prepare to update to 8.1.0.

Bug reports should be targeted against the 8.1.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

jhedstrom’s picture

Version: 8.1.x-dev » 8.2.x-dev
Status: Needs review » Needs work
Issue tags: +Needs reroll

Patch no longer applies.

ashishdalvi’s picture

Assigned: Unassigned » ashishdalvi
ashishdalvi’s picture

Status: Needs work » Needs review
StatusFileSize
new4.79 KB

Rerolled Patch.

Status: Needs review » Needs work

The last submitted patch, 39: 1632222-38.patch, failed testing.

rajeshwari10’s picture

Status: Needs work » Needs review
StatusFileSize
new4.79 KB

Applying Patch.

Status: Needs review » Needs work

The last submitted patch, 41: 1632222-41.patch, failed testing.

druprad’s picture

Assigned: ashishdalvi » Unassigned
Status: Needs work » Needs review
StatusFileSize
new4.79 KB

Patch rerolled for 8.2.x

Status: Needs review » Needs work

The last submitted patch, 43: make_node_module_inject-1632222-43.patch, failed testing.

The last submitted patch, 39: 1632222-38.patch, failed testing.

pashupathi nath gajawada’s picture

Assigned: Unassigned » pashupathi nath gajawada
Status: Needs work » Needs review
StatusFileSize
new4.82 KB

Please find the updated patch #46 with code indentation and with appropriate comments.

Thanks,

The last submitted patch, 43: make_node_module_inject-1632222-43.patch, failed testing.

Status: Needs review » Needs work

The last submitted patch, 46: 1632222-46.patch, failed testing.

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.

manuel garcia’s picture

Issue tags: -Needs reroll
yogeshmpawar’s picture

Status: Needs work » Needs review
StatusFileSize
new4.86 KB

Updated patch against 8.3.x

Status: Needs review » Needs work

The last submitted patch, 51: 1632222-51.patch, failed testing.

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.

smustgrave’s picture

Status: Needs work » Postponed (maintainer needs more info)
Issue tags: +stale-issue-cleanup

Thank you for sharing your idea for improving Drupal.

We are working to decide if this proposal meets the Criteria for evaluating proposed changes. There hasn't been any discussion here for over 8 years which suggests that this has either been implemented or there is no community support. Your thoughts on this will allow a decision to be made.

Since we need more information to move forward with this issue, the status is now Postponed (maintainer needs more info). If we don't receive additional information to help with the issue, it may be closed after three months.

Thanks!

Version: 11.x-dev » main

Drupal core is now using the main branch as the primary development branch. New developments and disruptive changes should now be targeted to the main branch.

Read more in the announcement.