Uploaded image for project: 'Lucee Development'
  1. LDEV-1718

Creating a / mapping causes incorrect path expansions

    Details

    • Type: Incompatibility
    • Status: Deployed
    • Priority: New
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 5.2.7.34
    • Labels:
      None
    • Sprint:
      March 2018

      Description

      When there is a CF mapping called "/' which points to a drive root, other mappings do not work if they match the names of real folders in the drive root pointed to by the "/" mapping.

      mappings = getApplicationSettings().mappings;
      
      // BROKEN BEHAVIOR ONLY EXISTS IF "/" MAPPING IS PRESENT
      mappings[ '/' ] = 'D:/';
      // This folder actually exists
      mappings[ '/commandboxInstall' ] = 'D:\artifacts';
      	
      application action="update" mappings="#mappings#";
      
      writeDump( getApplicationSettings().mappings );
      
      // This outputs correctly as "D:\"
      echo( "expandPath( '/' )" );
      writeDump( expandPath( '/' ) );
      
      // Expanding just the mapping correctly outputs "D:\artifacts\"
      echo( "expandPath( '/commandboxInstall/' )" );
      writeDump( expandPath( '/commandboxInstall/' ) );
      
      // Adding non-existent folder still correctly oututs "D:\artifacts\sdfsdf"
      echo( "expandPath( '/commandboxInstall/sdfsdf' )" );
      writeDump( expandPath( '/commandboxInstall/sdfsdf' ) );
      
      // Incorrectly outputs "D:\commandboxInstall\bar" which ignores the mapping
      // Note this only breaks if there actually is a real folder called "D:\commandboxInstall\bar"!!
      echo( "expandPath( '/commandboxInstall/bar' )" );
      writeDump( expandPath( '/commandboxInstall/bar' ) );
      

      Update:

      The resolution of this ticket was to add a new system property called lucee.mapping.first that you can set to true that should favor a mapping over a physical directory.

        Attachments

          Issue links

            Activity

              People

              • Assignee:
                michael1 Michael Offner
                Reporter:
                bdw429s Brad Wood
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: