we have code in node_filter_form() to deal with a 'term' filter:
if ($type == 'term') {
// Load term name from DB rather than search and parse options array.
$value = module_invoke('taxonomy', 'term_load', $value);
$value = $value->name;
}
and later on in the same foreach():
$t_args = array('%property' => $filters[$type]['title'], '%value' => $value);
problem is that node_filters(), which sets the $filters variable, can never return a $type = 'term' key for that array. so if any other code happens to set a 'term' filter, we'll get notices at that point.
we also handle the 'term' filter elsewhere, but again, if it was ever set, we'd get notices on the node admin screen.
is this code left over from D6? i think we should be killing it.
Comments
Comment #1
tr commentedSame code is in D8 - needs to be fixed there first.
Comment #2
Anonymous (not verified) commentedhere's a D7 patch that a) takes out the dead code and b) allows modules to hook into the 'admin/content' form without nasty cut-and-paste hackery, as they would be forced to do now.
Comment #3
Anonymous (not verified) commentedComment #4
tr commentedNeeds to go into D8 first.
Also, your patch does more than just remove the dead code - it adds a drupal_alter(). That's an API change and something that should definitely be discussed - I suggest doing that in a separate issue and confining this issue to removing dead code.
Comment #5
dawehnerThat page no longer exists like that, but is rather using a view.
Comment #6
tr commentedThe original patch makes three changes:
node_build_filter_query()node_filter_form()#3 is clearly out of scope of this issue, as pointed out in comment 4.
#2 is no longer an issue in D8, as pointed out in comment 5.
#1 is no longer an issue in D7 because it was done by #262498: Error in content administration using taxonomy filter about four months after this issue was opened.
What we're left with is just "Removes dead code from
node_filter_form()", and only in D7 not in D8.After looking at the code, it is clear #2 is still needed in D7.
node_filters()returns "List node administration filters that can be applied." but specifically it does not return a 'term' filter. Filter names taken from this list are stored in a $_SESSION variable, and this variable is used bynode_filter_form()to execute code conditionally in a switch statement depending on the filter name. Because 'term' is not a defined filter name, the case: that checks for the 'term' filter will never be executed.Here is an updated patch. Moved to 'minor' because there is no danger of this dead code making it into D8 anymore and because it can't really do much harm since it doesn't run.
Comment #7
avpadernoThe patch still applies and the analysis done in the previous comment is correct.
Comment #8
avpadernoComment #11
poker10 commentedTaxonomy node filter was removed in #693362: taxonomy_form_all() is dangerous and it seems like this was left here unintentionally.
I have done a quick search on the Drupal codebase via Gitlab a it seems like no contrib module is setting the
$_SESSION['node_overview_filter']variable, which should be the only way howtermcould end up here. Therefore I think this is safe to remove.Committed, thanks all!