Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
This is a follow-up of #2305919: Return 404 when trying to edit a non-existent feed..
A 404 should be returned for /import/%/log where "%" points to a non-existent importer. For this a Views argument validator plugin must be written. This plugin should extend "views_plugin_argument_validate".
Comment | File | Size | Author |
---|---|---|---|
#2 | feeds-views-validator-2333009-2.patch | 5.19 KB | MegaChriz |
Comments
Comment #1
MegaChriz CreditAttribution: MegaChriz commentedUpdated issue summary.
Comment #2
MegaChriz CreditAttribution: MegaChriz commentedIt appears to be that the argument in the path "/import/%/log" is already validated. This happens in views/feeds_views_handler_argument_importer_id.inc. It is that only the wrong action is taken when the argument is not valid. It should be "Show page not found" and not "Display contents of no result found".
A validator for "/node/%/log" indeed is needed. Now a "Log" tab shows up for every node, even when that node is not a feed node.
The attached patch does the following:
Side node: the Log view could be improved more. See #1393898: Order Log view by flid instead of log_time.
Comment #4
twistor CreditAttribution: twistor commentedAwesome!
We could probably add some configuration options for importer type to the feed node validator at some point, but this looks great.
Comment #5
twistor CreditAttribution: twistor commented@MegaChriz, I've uploaded a patch for #1393898: Order Log view by flid instead of log_time. Simple enough. How did you get the translatables export?
Comment #6
MegaChriz CreditAttribution: MegaChriz commentedAwesome work on Feeds, twistor!
Because I see these translatables always when I export a View, I thought they were added by default. Further exploration learns me that they are only exported when the core module "Locale" is enabled (or when Views' localization plugin gets overridden, see below), which I have enabled by default because I usually install my sites in Dutch.
From views/includes/view.inc, method
export()
, ± line 1917:Views uses its localization plugin to export translatables.
From views/views.module, ± line 1351:
The localization plugin can be overridden.