Autocomplete strips half of the dropdown content when Rendered Row From Views Display is used.

If I display 10 elements, then there is a 10 elements list in the dropdown but the first five elements are missing all of their content.

Debugging inside the Rewrite, with drupal_set_message("<pre>".print_r($row,1)); shows all ten entries.

I am listing a field in a taxonomy terms view.

Views 3.5, CTools 1.2, Drupal 7.15 - clean new installation, just for debugging this.

Anyone that has the same issue and knows a fix?

Comments

emilcarpenter’s picture

I found the cause of this and a simple solution. However, this was my first ever bug finding and fixing in any Drupal module, so I hope someone more experienced would look this over... :)

In the finder-directory, in the build.inc file, in the finder_build_style_render function,
I commented out the following line:

$style_plugin->view->row_index++;

I think that was line 357, if I havent forgotten any own debug code in the file.

So the lines around this line will look like this:

                $results[$value] = finder_sanitize($display, $format);
                //$style_plugin->view->row_index++; // Commented out this line by emilcarpenter.
              }
            }
          }
        }
      }
      else {
        if ($finder->setting('results_style') == 'views' || ($finder->setting('results_style') == 'custom' && $finder->setting('custom_results_style_render')) ) {
          $row->render = $style_plugin->row_plugin->render($row);
          // This is code to get rid of extra whitespace, could be useful for some future feature?
          //$row->render = preg_replace('/\s+/', ' ', trim($row->render));
          $row->display_key = 'render';
        }
        $results[] = $row;
      }
      $style_plugin->view->row_index++;
    }
  }
  unset($style_plugin->view->row_index);

bechtold’s picture

Status: Active » Patch (to be ported)
StatusFileSize
new395 bytes

Had the same error and emilcarpenter's solution worked.
So I made a patch.
It's the first patch I made, so please check if everything is working.

blackmyers87’s picture

That worked for me, Thanks a lot :)

kiwimind’s picture

I have made this change to the module as was experiencing a similar issue, using several fields rather than taxonomy. All working as expected now.

Thanks.

khalor’s picture

Version: 7.x-2.0 » 7.x-2.x-dev
Issue summary: View changes
Status: Patch (to be ported) » Reviewed & tested by the community

Applied, fixes the issue

  • danielb committed fd009e8 on 7.x-2.x authored by bechtold
    Issue #1814772 by bechtold: Autocomplete strips half of the dropdown...
danielb’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.