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.
In the method views_handler_filter_term_node_tid::init, bitwise &
is used where clearly &&
was intended:
if (isset($this->options['vid']) && !empty($this->options['vid']) & empty($this->options['vocabulary'])) {
In this case, the outcome would be the same regardless. But such mistakes should be corrected, because some adjustment to the if control structure, and this could cause a problem that is difficult to spot.
For example, suppose we change it to:
if ($this->options['vid'] & empty($this->options['vocabulary'])) {
Then half the time this works as expected.
Comment | File | Size | Author |
---|---|---|---|
#2 | bitwise_and-views-2503717-2.patch | 841 bytes | MiroslavBanov |
Comments
Comment #1
MiroslavBanov CreditAttribution: MiroslavBanov commentedComment #2
MiroslavBanov CreditAttribution: MiroslavBanov commentedComment #3
Chris Matthews CreditAttribution: Chris Matthews as a volunteer commentedThe 4 year old patch in #2 to views_handler_filter_term_node_tid.inc applied cleanly to the latest views 7.x-3.x-dev and if still relevant needs to be reviewed.