- Issue created by @claudiu.cristea
- π¬π·Greece dimilias
idimopoulos β made their first commit to this issueβs fork.
- π¬π·Greece dimilias
Let's block this on https://www.drupal.org/project/track_usage/issues/3535768 π Replace JSON column with normalized table structure Active
- π¬π·Greece dimilias
Starting again since the relevant ticket was completed.
- π¬π·Greece dimilias
We have discussed with Claudiu and out weighted the pros and the cons.
The task is updated to have a "Delete selected/Delete all" list of buttons.
No tests will be required.
We have decided to go with the custom form instead of the views due to:
* The footprint of the code is more or less the same (<100 lines diff) but the views version also have the view in the export which is another 500+ lines file.
* Views offer out of the box some stuff but all fields still need to be added via the views data. Please, note, that if that was the only thing, then views, naturally succeed in this because of the out of the box UI afterwards. However:
* We anyway have to write custom code for the paths. Even if we were to write all in the views and use aggregation, still it would be not an easy task to achieve the same result as requested in views (because of the multiple keys in the table).
* We anyway have to write custom code for the filters to achieve to be a select list of available types.
* We anyway have to write custom code for the delete selected/all buttons.Thus, we are going to go with a custom form rather than a view. I am closing MR14.
- π¬π·Greece dimilias
Please, note, that this includes an update to ddev-drupal-contrib because I needed the
ddev core-version
command to debug the issue - and yes, I understand that I could do it with the environment variable but at some point, we should update this too.
Still, if you find this irrelevant, please feel free to reject or revert the commit. - π·π΄Romania claudiu.cristea Arad π·π΄
Manual test:
Ran:
ddev composer require drupal/devel --dev --no-update ddev poser ddev install
Created a track config named "test":
- "Record entity changes in real time" set to ON
- Source entity types: Content/Article
- Target entity types: File
Generating some content:
ddev drush en devel_generate ddev drush genc 300 --bundles=article
Accessed https://track-usage.ddev.site/admin/config/system/usage-track I see 300 track records created.
Accessed https://track-usage.ddev.site/admin/config/system/usage-track/browse/test
From "Source entity type" I've selected "Content". Pressed "Apply filters"
But got:Drupal\Core\Database\DatabaseExceptionWrapper: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'tu.source_type' in 'where clause': SELECT COUNT(*) AS "expression" FROM (SELECT 1 AS "expression" FROM "track_usage" "track_usage" LEFT OUTER JOIN "track_usage_paths" "track_usage_paths" ON track_usage_paths.tid = track_usage.tid WHERE ("config" = :db_condition_placeholder_0) AND ("tu"."source_type" = :db_condition_placeholder_1)) "subquery"; Array ( [:db_condition_placeholder_0] => test [:db_condition_placeholder_1] => node ) in Drupal\track_usage\Form\BrowseUsagesForm->buildRows() (line 256 of /var/www/html/src/Form/BrowseUsagesForm.php).
Same happens if you select something from the target filter
Didn't perform yet a code review.
- Assigned to dimilias
- Status changed to Needs work
2 months ago 1:38pm 12 August 2025 - π¬π·Greece dimilias
Something went wrong with this in the meantime. Data are not tracked for me. Also, setting this to needs work since there were remarks.
-
andras_szilagyi β
committed 171630ea on 1.x authored by
idimopoulos β
Issue #3529757 by idimopoulos, claudiu.cristea: UI to browse usage...
-
andras_szilagyi β
committed 171630ea on 1.x authored by
idimopoulos β
Automatically closed - issue fixed for 2 weeks with no activity.
Now that this issue is closed, please review the contribution record.
As a contributor, attribute any organization helped you, or if you volunteered your own time.
Maintainers, please credit people who helped resolve this issue.