I found that In string length access plugin "Equal to" option not work

In ctools_string_length_ctools_access_settings operator defenition following

  $form['settings']['operator'] = array(
    '#type' => 'radios',
    '#title' => t('Operator'),
    '#options' => array(
......
      '=' => t('Equal to'),
......
    ),
    '#default_value' => $conf['operator'],
  );

but in ctools_string_length_ctools_access_check operator switch following

  switch ($conf['operator']) {
.................
    case '==':
      return $length == $conf['length'];
..............
  }
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

niko-’s picture

Patches for ctools drupal 7/8.1/8.2 versions attached
Not sure if any test need for this fixes

andypost’s picture

Priority: Normal » Major
Status: Needs review » Reviewed & tested by the community

Yeah! Serious typo.
is there any tests?

japerry’s picture

Status: Reviewed & tested by the community » Needs review
FileSize
792 bytes

hmm seeing that the check should -always- fail because the operator didn't match '==' I think this is good. I added a return FALSE at the end to catch any errant settings, and to be less confusing to developers. if this looks good I'll push that up.

niko-’s picture

Status: Needs review » Reviewed & tested by the community

Hi Jakob

Looks good.

mrjmd’s picture

japerry’s picture

Status: Reviewed & tested by the community » Fixed
Issue tags: +SprintWeekend2015

Awesome. Fixed.

  • japerry committed 85cfe1f on 7.x-1.x
    Issue #2399033 by niko-, japerry: In string length access plugin "Equal...

Status: Fixed » Closed (fixed)

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