Jump to content
  • [B3] Pages Records - Multiple Upload field returns urls, not the file objects when using custom display option


    Could contain: Page, Text, File, Webpage

    After not getting any output with the usual $file->stuff I dumped the $values values as they iterated to txt to see what was there. Nothing but urls:

    https://redacted.com/uploads/monthly_2024_11/AnnualReport2023-SpreadView_pdf.d0f09d909c8223ab03f54e89e32b1de9

    Tested against $formValue as well to be sure, no objects.


    User Feedback

    Recommended Comments

    Chris59

    Posted (edited)

    Yes I have similar issue here in my garage database

    Could contain: Machine, Spoke, Wheel, Alloy Wheel, Car, Car Wheel, Tire, File, Person, Coupe

    Edited by Chris59
    Baian007

    Posted

    <div class="ipsGrid ipsGrid_collapsePhone custom-image-grid">
        {{foreach $value as $file}}
            <div class="ipsGrid_span3">
                <a href="{$file}" title="Enlarge image" data-ipslightbox="" data-ipslightbox-group="g70039">
                    <img src="{$file}" style="width: 100%; height: 100%;" alt="Image" class="ipsImage_thumbnailed">
                </a>
            </div>
        {{endforeach}}
    </div>

    I use this code to display multi images and it works

    Chris59

    Posted (edited)

    6 minutes ago, Baian007 said:
    <div class="ipsGrid ipsGrid_collapsePhone custom-image-grid">
        {{foreach $value as $file}}
            <div class="ipsGrid_span3">
                <a href="{$file}" title="Enlarge image" data-ipslightbox="" data-ipslightbox-group="g70039">
                    <img src="{$file}" style="width: 100%; height: 100%;" alt="Image" class="ipsImage_thumbnailed">
                </a>
            </div>
        {{endforeach}}
    </div>

    I use this code to display multi images and it works

    Thanks mate , but there is bugreport i make on this and hope it will be solved in beta 4 , but i tried you suggest
    https://eadrifting.se/index.php?/garaget/garage_privatcar/nissan-sx180-s13ps13-r1/

    Need some tweaks , i will keep it to a fix is coming
    Thanks 

    Edited by Chris59
    All Astronauts

    Posted

    Beta 4 this is still returning urls. However - instead of a plain text URL, it is outputting links:

    		<a href="https://redacted.com/applications/cms/interface/file/file.php?record=1&amp;database=3&amp;fileKey=[!AES128GCM[EvImxn/4tK%2BtU9LTDMyzSb2gRDbGZo8wr5ImABetP/0MtK9dOLKpMJSh08O2gpV4CXOQnybz9jTQqDepccy9qS557UnZ1iUJyfOkEYr15xk695ds][e07f7365c1d48bec68685afd][7df3e82fad182d876135ff15f948c202]]&amp;file=SpreadView.pdf">SpreadView.pdf</a>

    A few newlines before that as well in the dump (cut for the example above)

    All Astronauts

    Posted (edited)

    Also, not worth a new report but a slight efficiency improvement

    cms/module/front/database/record/manage - line 263

    		if ( $record->record_image )
    		{
    			Output::i()->metaTags['og:image'] = (string) File::get( 'cms_Records', $record->record_image )->url;
    		}

    Starting at line 335 you run the same file obj init on record_image. I'd just shove that metatag output line there.

    Well... as Output::i()->metaTags['og:image'] = (string) $imageObj->url of course 🙂

    	/* Image is required */
    		if( $record->record_image )
    		{
    			try
    			{
    				$imageObj	= File::get( 'cms_Records', $record->record_image );
    
    				Output::i()->jsonLd['article']['image'] = array(
    					'@type'		=> 'ImageObject',
    					'url'		=> (string) $imageObj->url
    				);
    			}
    			/* File doesn't exist */
    			catch ( RuntimeException | DomainException $e ){}
    		}
    		else

     

    Edited by All Astronauts

×
×
  • Create New...