Uploaded image for project: 'In-Portal CMS'
  1. In-Portal CMS
  2. INP-910

Field options are changed by accident during image (from field) display

    XMLWordPrintable

    Details

    • Type: Bug Report
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 5.1.3-RC2
    • Fix Version/s: 5.1.3
    • Component/s: File Uploader
    • Labels:
      None

      Description

      Each In-Portal's database table field, that allows image upload to be performed is described with a set of upload-specific options in associated database table unit config file.

      'Fields' => Array (
      'Logo' => Array (
      'type' => 'string',
      'formatter' => 'kUploadFormatter',
      'upload_dir' => IMAGES_PATH.'manufacturers/',
      'file_types' => '.jpg;.gif;*.png', 'files_description' => 'Unable to render embedded object: File (la_hint_ImageFiles) not found.',
      'multiple' => false, 'thumb_format' => 'resize:100x100',
      'max_len' => 255, 'not_null' => 1, 'default' => ''
      ),
      ),

      There is also a rarely used option called "direct_links", that is turned off by default.

      When this option:
      is turned on, then path to image is shown to user (in url to that image), e.g. http://www.website.tld/system/images/manufacturers/image_filename.jpg
      is turned off then path is totally hidden and intermediate In-Portal's event OnViewFile is used to display an image: http://www.website.tld/index.php?env=-page_template_here:m0--1--s-1:manuf-0---OnViewFile-t1&field=Logo&file=619339.jpg
      So if you don't want to disclose actual location of file, then you'd probably with that option to be turned off (that is by default).

      However, when you're trying to use 1 field to display any 2+ images not stored in that field:

      $object->SetDBField('Logo', 'image1.jpg');
      $url_one = $object->GetField('Logo', 'full_url');

      $object->SetDBField('Logo', 'image2.jpg');
      $url_two = $object->GetField('Logo', 'full_url');

      then $url_one will have link with OnViewFile event, but $url_two will have direct link to an image.

      That's a bug, since direct_link option is changed in the middle by mistake.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                alex Alex
                Reporter:
                alex Alex
                Developer:
                Alex
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: