- Issue created by @keiserjb
- πΊπΈUnited States swirt Florida
Hi KeiserJB thank you for reporting this. I will look into it after the new year.
Is there anything special / different about your nodes? Are you using workflow or anything on them? Are you using revisions? If you look at recent log messages are there any notices or errors when looking at the node count report?
I am not seeing counts being off on any of my current installs, but this is certainly worth looking into.
- πΊπΈUnited States keiserjb
I'll look at it again next week. I don't recall any errors. The report just shows zeros for the counts when they are not supposed to be zero. I made a custom module this afternoon to display the node counts and it was all correct.
Something very well could have gotten scrambled during the migration. The content types not working were Features in D7 that were unfeaturized and migrated but they seem to work other than this report.
- πΊπΈUnited States keiserjb
I've found that if I create new nodes, the new ones show up in the report. The old ones that were migrated do not. Perhaps I can find what is happening and trick the old nodes into resaving correctly.
- πΊπΈUnited States swirt Florida
To me that hints that maybe you have revisions turned on but your migration did not create a new revision and only subsequent saves do.
Using the Views bulk operation module would allow you to bulk save them all, that might slave the problem. My bet is your migration configuration is incomplete and needs to be reworked and then an update migration run.
- πΊπΈUnited States swirt Florida
If you post your migration yml file here I can take a look and see if I can spot what is going on.
- πΊπΈUnited States swirt Florida
If it is not something you want public, you can DM it to me in Drupal Slack.
- πΊπΈUnited States keiserjb
I did the migration with the UI so there weren't any custom migration files. This might be a weird scenario with the content types being Features in D7 and then migrated.
- πΊπΈUnited States keiserjb
I think I found it. The langcode for all of the migrated content was set to und. I discovered that new content was set to en. Changing the database for the langcode table fixes the display. I just wish there was an easier way to update the database.
- πΊπΈUnited States swirt Florida
That is interesting and may be the cause of the bad counts, though I would think correct node counts should not be language dependent so there still may be something else at play. I will look into the count part soon.
- πΊπΈUnited States swirt Florida
If the migrated content has not been touched by human editors you could always roll back the migration, the set the language in the migration and run it again.
- πΊπΈUnited States keiserjb
Rolling back wasn't really an option. Too much had happened. That being said, I updated all the tables in my database where the langcode was und. Everything works now.
- πΊπΈUnited States swirt Florida
I am glad this worked out for you with adding the language to the table. I think it surfaced a problem in your migrated data, but I also see that there is a problem with this report and the way it only looks only for the specified default language.
https://git.drupalcode.org/project/content_model_documentation/-/blame/1...
It should really look through all languages. So I am leaving this open until I can get that reworked. - First commit to issue fork.
- Status changed to Needs review
9 months ago 9:47am 21 February 2024 - πΊπΈUnited States mortona2k Seattle
I just removed the default language from the nid count aggregation. Seems to be providing accurate numbers.
I'm not sure what other factors need to be considered. I think this way of counting is fine because translated nodes don't have a differen't nid like they used to.
--
This site appears to have a mix of und and en content, most likely from a previous migration.
I recall finding a script or module a while back that went through every table and updated the column, but not sure where that went. Looks like the alternative is to do manual sql queries or use vbo.
I've encountered other problems from messed up languages before, probably worth cleaning up to avoid hidden issues.
- πΊπΈUnited States swirt Florida
@mortona2k thank you for looking into this. This is a good solution. You are right the counting by language makes no sense with the way translation is happening now in Drupal with them all being the same node.
I'll pull out the whole language column from the report because now it is misleading. I'll get this merged shortly.
-
swirt β
committed bb181973 on 1.0.x authored by
mortona2k β
Issue #3410579 by mortona2k: Incorrect Node Counts
-
swirt β
committed bb181973 on 1.0.x authored by
mortona2k β
- Status changed to Fixed
9 months ago 2:36pm 21 February 2024 - πΊπΈUnited States swirt Florida
I just committed mortona2k's patch and removed language entirely from the node and vocabulary table reports.
It will go out shortly with 1.0.25Thank you @mortona2k for your work on this and keiserjb for raising it.
- Status changed to Fixed
9 months ago 2:43pm 21 February 2024 - πΊπΈUnited States swirt Florida
This has been released
https://www.drupal.org/project/content_model_documentation/releases/1.0.25 β