6 Replies Latest reply on Feb 5, 2016 6:25 AM by TSGal

    FileMaker PHP API - listValueLists() method prevents value lists from showing

    databuzz

      Product and version - FileMaker Server 14.0.4.413

       

      OS and version - Mac OS X 10.10.5

       

      Description

      Including the listValueLists() method in PHP page that then references a value list prevents the value list from displaying. This only appears to happen with value lists from field values (e.g. related records) not custom values.

       

      How to replicate

      Create a PHP page that uses a value list which uses field values to show in a select menu. Include the listValueLists() method before retrieving the value list. For example:

       

      $layout = $fm->getLayout('WebPHPSites');

      $valueListNames = $layout->listValueLists();

      $codes = $layout->getValueListTwoFields('RelatedCodes' , $siteRecordID) ;

      echo '<p><pre>'.print_r ($codes).'</pre></p>';

       

      displays the following in the browser:

      Array

      (

      )

      <p><pre>1</pre></p>

       

      Workaround (if any)

       

      Not including the listValueLists() method or including it after any references to value lists appears to prevent the issue. For example:

       

      $layout = $fm->getLayout('WebPHPSites');

      $codes = $layout->getValueListTwoFields('RelatedCodes' , $siteRecordID) ;

      echo '<p><pre>'.print_r ($codes).'</pre></p>';

       

      displays the following in the browser:

       

      Array

      (

          [Code1] => Code1

          [Code2] => Code2

          [Code3] => Code3

      )

      <p><pre>1</pre></p>