Jump to content
aComAdi

Image Field: Empty URL

Recommended Posts

Hi,

Have been working with ProcessWire for a few months now, successfully implementing several sites. I am compiling data management into modules for our clients. Several sites are using those modules now. The modules are using RockMigrations to install fileds, templates and pages.

Today, I installed a new site. And now I am tripping over an issue that I cannot explain. Content on pages is organized in 'rows'. The users can add row by using RepeaterMatrix...then completing the fields to add data to the row. One particular content row has image fields. When I upload the images to the fields, all works as expected. The images appear in the RepeaterMatrix and I do find the images in assets/files/xxxx. But the images are not displayed in the front-end (see attachment). As you can see in the attachment, the various text and textarea fields in the RepeaterMatrix item are displayed correctly.

I have done the following:

  • Compare field settings to the existing implementations: they are identical
  • Compare the RepeateMatrix settings and permissions to existing implementations: they are identical
  • Change field name. No change.
  • Delete field and created manually (including once with different name). No change.

If I dump the element with Tracey, I get the following output:

  • If Max Number = 1
    • null
  • If Max Number = 0
    • count => 0
      page => "/processwire/repeaters/for-field-136/for-page-1/1574873590-62-1/" (60)
      field => "wk_inhalt_start_links_bild" (26)
      url => "/serverpath/site/assets/files/1046/" (30)
      path => "/serverpath/serverpath/serverpath/serverpath/site/assets/files/1046/" (56)
      items => array ()

I would venture that there is an issue regarding images on the shared server...but another content element on the site works just fine with images.

Bit stumped right now. Especially considering that I made the same installation earlier today on a different server successfully. I would appreciate any ideas on where to investigate this issue.

screenshot-ford-gerbsch.ch-2019.11.27-18_45_15.png

Share this post


Link to post
Share on other sites

Follow-up:

I just ran a test with a different row type in that RepeaterMatrix and have the same issue: images can be uploaded, appear in the CMS, are up on the server...but are not displayed.

Share this post


Link to post
Share on other sites

What's your relevant code in your template file?

29 minutes ago, aComAdi said:

url => "/serverpath/site/assets/files/1046/"

That's not an image/file URL, i.e. not $imagefieldname->url

30 minutes ago, aComAdi said:

items => array ()

What's inside this array? I guess the images? Or is it empty?

Looking at your screenshot, why is there a visible <img src=... in the middle of nowhere? Did you inspect that?

Share this post


Link to post
Share on other sites

The object output I posted above, is from the dumping of the images field with Tracey Debugger:

bd($inhaltszeile->wk_inhalt_start_links_bild);

Regarding the weird output with the image tag: must have made a c&p mistake while trying to debug this issue. Has nothing to do with the problem at hand. Fixed the html issue though. (See screeshot attached.)

Here's a compacted version of the code which leads to the issue.

Code processing the RepeaterMatrix

foreach($page->wk_inhalt_zeile as $inhaltszeile) {
	switch ($inhaltszeile->repeater_matrix_type) {
		case '2':
        	bd($inhaltszeile->wk_inhalt_start_links_bild);
        	require  $_SERVER['DOCUMENT_ROOT'].$config->urls->templates.'_inhalt_occneu.php';
        	break;
	}
}

Code processing the RepeaterMatrix item in question, including the images:

<section class="about-us-section section-padding">
  <div class="container">
    <div class="section-header text-center">
      <h2><?php echo $inhaltszeile->wk_inhalt_titel; ?></h2>
      <?php echo $inhaltszeile->wk_inhalt_text1; ?>
    <div class="row">
      <div class="col-lg-6 col-sm-6">
        <div class="looking-car">
          <div class="looking-cat-image"> <img src="<?php echo $inhaltszeile->wk_inhalt_start_links_bild->url; ?>" alt="<?php echo $inhaltszeile->wk_inhalt_start_links_titel; ?>" /></div>
          <div class="looking-car-content">
            <h3><?php echo $inhaltszeile->wk_inhalt_start_links_titel; ?></h3>
            <?php
              echo $inhaltszeile->wk_inhalt_start_links_text;
            ?>
            <a href="<?php echo $inhaltszeile->wk_inhalt_start_links_link; ?>" class="btn"><?php echo __('Anzeigen'); ?><i class="fa fa-chevron-circle-right" aria-hidden="true"></i></a> </div>
        </div>
      </div>
      <div class="col-lg-6 col-sm-6">
        <div class="looking-car">
          <div class="looking-cat-image"> <img src="<?php echo $inhaltszeile->wk_inhalt_start_rechts_bild->url; ?>" alt="<?php echo $inhaltszeile->wk_inhalt_start_rechts_titel; ?>" /> </div>
          <div class="looking-car-content">
            <h3><?php echo $inhaltszeile->wk_inhalt_start_rechts_titel; ?></h3>
            <?php
              echo $inhaltszeile->wk_inhalt_start_rechts_text;
            ?>
            <a href="<?php echo $inhaltszeile->wk_inhalt_start_rechts_link; ?>" class="btn"><?php echo __('Anzeigen'); ?><i class="fa fa-chevron-circle-right" aria-hidden="true"></i></a> </div>
        </div>
      </div>
    </div>
  </div>
</section>

Notes:

  • Same code works as expected on other installations
  • Images are uploaded and visible in RepeaterMatrix Item in CMS
  • The RepeaterMatrix item is processed as expected in the front-end, with the exception of the image fields
  • Image fields in other RepeaterMatrix Types in the front-end are also not working correctly.

I have the suspicion, that this is an issue with the RepeaterMatrix, although all settings of the field are identical to other installations. Still appreciating ideas on where to dig with this. In the meantime, I will manually setup a new RepeaterMatrix.

 

screenshot-ford-gerbsch.ch-2019.11.28-08_28_03.png

Share this post


Link to post
Share on other sites

Update: manually created a new RepeaterMatrix and new image fields. Same results: the object returned does not contain the uploaded image.

Share this post


Link to post
Share on other sites

Hi @Gideon So,

Indeed I have. As a matter of fact, that is the intended setting, as only one image is allowed for the posting.

screenshot-ford-gerbsch.ch-2019_11.28-10_48_21.thumb.png.a511713e0aca234b75aa9a46f937c596.png

 

In this case when I dump the field, the response is Null

bd($inhaltszeile->wk_inhalt_start_links_bild);

If I switch Max Image settings to 0 (for debugging purposes), then I do recieve the above posted object back, but no images.

I honestly consider wiping the whole installation and starting new. Somethings is fishy here. I have also compared the settings of working vs non-working image fields. They seem identical:

{
    "wk_slider_bild": {
        "id": 179,
        "type": "FieldtypeImage",
        "flags": 0,
        "name": "wk_slider_bild",
        "label": "Slider/Banner-Bild",
        "columnWidth": 50,
        "description": "Bnnerbild",
        "entityencodedesc": 1,
        "extensions": "gif jpg peg png",
        "adminThumbs": 1,
        "maxFiles": 1,
        "fileSchema": 6,
        "outputFormat": 0,
        "outputString": "",
        "defaultValuePage": "",
        "textformatters": "",
        "entityEncode": "",
        "useTags": 0,
        "tagsList": "",
        "inputfieldClass": "InputfieldImage",
        "collapsed": 0,
        "showIf": "",
        "themeOffset": "",
        "themeBorder": "",
        "themeColor": "",
        "required": "",
        "requiredIf": "",
        "unzip": "",
        "overwrite": "",
        "descriptionRows": 1,
        "noLang": "",
        "gridMode": "grid",
        "focusMode": "on",
        "maxWidth": "",
        "maxHeight": "",
        "resizeServer": 0,
        "maxSize": "",
        "clientQuality": 90,
        "maxReject": "",
        "minWidth": "",
        "minHeight": "",
        "dimensionsByAspectRatio": ""
    }
}

{
    "wk_inhalt_start_links_bild": {
        "id": 211,
        "type": "FieldtypeImage",
        "flags": 0,
        "name": "wk_inhalt_start_links_bild",
        "label": "Start Intro Links: Bild",
        "extensions": "gif jpg jpeg png",
        "maxFiles": 1,
        "outputFormat": 0,
        "defaultValuePage": "",
        "useTags": 0,
        "inputfieldClass": "InputfieldImage",
        "descriptionRows": 1,
        "gridMode": "grid",
        "focusMode": "on",
        "resizeServer": 0,
        "clientQuality": 90,
        "maxReject": "",
        "dimensionsByAspectRatio": "",
        "fileSchema": 6,
        "collapsed": 0,
        "columnWidth": 50,
        "outputString": "",
        "textformatters": "",
        "entityEncode": "",
        "tagsList": "",
        "showIf": "",
        "themeOffset": "",
        "themeBorder": "",
        "themeColor": "",
        "required": "",
        "requiredIf": "",
        "unzip": "",
        "overwrite": "",
        "noLang": "",
        "maxWidth": "",
        "maxHeight": "",
        "maxSize": "",
        "minWidth": "",
        "minHeight": ""
    }
}

Somewhere along the way, something went wrong with the installation and there's an issue with either permissions on the RepeaterMatrix level or the Templates.

Share this post


Link to post
Share on other sites

I wiped the installation and started new. I am ending up at the same place. The RepeaterMatrix simply drops the fields of type Image.

That's the setup with a different item, but essentially having the same process as the original post above. Just replace wk_inhalt_start_links_bild with wk_inhalt_bilder :

screenshot-ford-gerbsch.ch-2019_11.28-14_45_13.thumb.png.b035c10401e5707bd2910037d3d2a8a6.png

Here I fill the fields successfully:

screenshot-ford-gerbsch.ch-2019_11.28-14_47_12.thumb.png.9c34f0f2993d49038d85c2ec444eff47.png

And when I dump the RepeaterMatrix item in the front-end, it's missing the image fields (wk_inhalt_bilder, wkinhaltbilder):

screenshot-ford-gerbsch.ch-2019_11.28-14_48_37.png.6ffa171eb5b27d30893b2ced59c00b7f.png

Starting to get desperate here.

 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By Robin S
      Add Image URLs
      Allows images/files to be added to Image/File fields by pasting URLs.

      Usage
      Install the Add Image URLs module.
      A "Paste URLs" button will be added to all image and file fields. Use the button to show a textarea where URLs may be pasted, one per line. Images/files are added when the page is saved.
       
      https://github.com/Toutouwai/AddImageUrls
      https://modules.processwire.com/modules/add-image-urls/
    • By gebeer
      Hello all,
      sharing my new module FieldtypeImageReference. It provides a configurable input field for choosing any type of image from selectable sources. Sources can be: 
      a predefined folder in site/templates/ and/or a  page (and optionally its children) and/or the page being edited and/or any page on the site CAUTION: this module is under development and not quite yet in a production-ready state. So please test it carefully.
      UPDATE: the new version v2.0.0 introduces a breaking change due to renaming the module. If you have an older version already installed, you need to uninstall it and install the latest master version.
      Module and full description can be found on github https://github.com/gebeer/FieldtypeImageReference
      Install from URL: https://github.com/gebeer/FieldtypeImageReference/archive/master.zip
      Read on for features and use cases.
      Features
      Images can be loaded from a folder inside site/templates/ or site/assets Images in that folder can be uploaded and deleted from within the inputfield Images can be loaded from other pages defined in the field settings Images can be organized into categories. Child pages of the main 'image source page' serve as categories mages can be loaded from any page on the site From the API side, images can be manipulated like native ProcessWire images (resizing, cropping etc.), even the images from a folder Image thumbnails are loaded into inputfield by ajax on demand Source images on other pages can be edited from within this field. Markup of SVG images can be rendered inline with `echo $image->svgcontent` Image names are fully searchable through the API $pages->find('fieldname.filename=xyz.png'); $pages->find('fieldname.filename%=xy.png'); Accidental image deletion is prevented. When you want to delete an image from one of the pages that hold your site-wide images, the module searches all pages that use that image. If any page contains a reference to the image you are trying to delete, deletion will be prevented. You will get an error message with links to help you edit those pages and remove references there before you can finally delete the image. This field type can be used with marcrura's Settings Factory module to store images on settings pages, which was not possible with other image field types When to use ?
      If you want to let editors choose an image from a set of images that is being used site-wide. Ideal for images that are being re-used across the site (e.g. icons, but not limited to that).
      Other than the native ProcessWire images field, the images here are not stored per page. Only references to images that live on other pages or inside a folder are stored. This has several advantages:
      one central place to organize images when images change, you only have to update them in one place. All references will be updated, too. (Provided the name of the image that has changed stays the same) Installation and setup instructions can be found on github.
      Here's how the input field looks like in the page editor:

      If you like to give it a try, I'm happy to hear your comments or suggestions for improvement. Install from URL: https://github.com/gebeer/FieldtypeImageReference/archive/master.zip
      Eventually this will go in the module directory, too. But it needs some more testing before I submit it. So I'd really appreciate your assistance.
      Thanks to all who contributed their feedback and suggestions which made this module what it is now.
       
    • By rushy
      Hi. I've been using Processwire for a few years now and installed it on a few different shared hosting servers without issues, but I'm now running into an issue on a Fasthosts shared server that I've not seen before. The installation goes ok and I have a working default site profile but I am unable to complete any uploads of images. It just hangs at the progress spinner during the upload. I thought it might be a priviledge issue so have temporarily set the dir / file privs. as 777 / 666 just to test that but it made no difference. I have no errors in the wire log. In server error log I have:
      set_time_limit() has been disabled for security reasons in ....htdocs/wire/core/ImageSizerEngine.php on line 1035 and i note in the assets/file dir. where the image is being stored the date on the file being created has a year of 1970 and 0 length. If I leave the page this file disappears and nothing has been stored. 
      Does anyone know how I can enable set_time_limit if this is likely to be the problem? 
      Many thanks! Paul
    • By gebeer
      EDIT: all development and discussion of this module has been moved to Module FieldtypeImagePicker which now contains all features of this module and more. This module will not be maintained any further. The information below remains for pure historical reasons.
      I am happy to present my new fieldtype FieldtypeImageFromPage. It is made up of 2 modules:
      Fieldtype Image Reference From Another Page is a Fieldtype that stores a reference to a single image from another page. The image can be selected with the associated Inputfield.
      Inputfield Select Image From Page is an Inputfield to select a single image from images on a predefined page and it's children.
      And there also is a helper module that takes care of cleanup tasks.
      This module evolved out of a discussion about my other Module FieldtypeImagePicker.  It caters for use cases where a set of images is being reused multiple times across a site. With this fieldtype these images can be administered through a chosen page. All images uploaded to that page will be available in the inputfield.
      When to use ?
      Let editors choose an image from a set of images that is being used site-wide. Ideal for images that are being re-used across the site.
      Suited for images that are used on multiple pages throughout the site (e.g. icons).
      Other than the native ProcessWire images field, the images here are not stored per page. Only references to images on another page are stored. This has several advantages:
      one central place to organize images when images change, you only have to update them in one place. All references will be updated, too. (Provided the name of the image that has changed stays the same) Features
      Images can be manipulated like native ProcessWire images (resizing, cropping etc.) Image names are fully searchable through the API Accidental image deletion is prevented. When you want to delete an image from one of the pages that hold your site-wide images, the module searches all pages that use that image. If any page contains a reference to the image you are trying to delete, deletion will be prevented. You will get an error message to help you edit those pages and remove references there before you can finally delete the image. How to install and setup
      Download and install this module like any other modules in ProcessWire Create a page in the page tree that will hold your images. This page's template must have an images field Upload some images to the page you created in step 2 Create a new field. As type choose 'Image Reference From Another Page'. Save the field. In 'Details' Tab of the field choose the page you created in step 2 Click Save button Choose the images field name for the field that holds your images (on page template from step 2) Click Save button again Choose whether you want to include child pages of page from step 2 to supply images Add the field to any template You are now ready to use the field View of the inputfield on the page edit screen:

      View of the field settings

      The module can be installed from this github repo. Some more info in the README there, too.
      In my tests it was fairly stable. After receiving your valued feedback, I will eventually add it to the modules directory.
      My ideas for further improvement:
      - add ajax loading of thumbnails
      Happy to hear your feedback!
       
    • By David Karich
      ProcessWire InputfieldRepeaterMatrixDuplicate
      Thanks to the great ProModule "RepeaterMatrix" I have the possibility to create complex repeater items. With it I have created a quite powerful page builder. Many different content modules, with many more possible design options. The RepeaterMatrix module supports the cloning of items, but only within the same page. Now I often have the case that very design-intensive pages and items are created. If you want to use a content module on a different page (e.g. in the same design), you have to rebuild each item manually every time.
      This module extends the commercial ProModule "RepeaterMatrix" by the function to duplicate repeater items from one page to another page. The condition is that the target field is the same matrix field from which the item is duplicated. This module is currently understood as proof of concept. There are a few limitations that need to be considered. The intention of the module is that this functionality is integrated into the core of RepeaterMatrix and does not require an extra module.
      Check out the screencast
      What the module can do
      Duplicate a repeater item from one page to another No matter how complex the item is Full support for file and image fields Multilingual support Support of Min and Max settings Live synchronization of clipboard between multiple browser tabs. Copy an item and simply switch the browser tab to the target page and you will immediately see the past button Support of multiple RepeaterMatrix fields on one page Configurable which roles and fields are excluded Duplicated items are automatically pasted to the end of the target field and set to hidden status so that changes are not directly published Automatic clipboard update when other items are picked Automatically removes old clipboard data if it is not pasted within 6 hours Delete clipboard itself by clicking the selected item again Benefit: unbelievably fast workflow and content replication What the module can't do
      Before an item can be duplicated in its current version, the source page must be saved. This means that if you make changes to an item and copy this, the old saved state will be duplicated Dynamic loading is currently not possible. Means no AJAX. When pasting, the target page is saved completely No support for nested repeater items. Currently only first level items can be duplicated. Means a repeater field in a repeater field cannot be duplicated. Workaround: simply duplicate the parent item Dynamic reloading and adding of repeater items cannot be registered. Several interfaces and events from the core are missing. The initialization occurs only once after the page load event Changelog
      1.0.4
      Bug fix: Various bug fixes and improvements in live synchronization Bug fix: Items are no longer inserted when the normal save button is clicked. Only when the past button is explicitly clicked Feature: Support of multiple repeater fields in one page Feature: Support of repeater Min/Max settings Feature: Configurable roles and fields Enhancement: Improved clipboard management Enhancement: Documentation improvement Enhancement: Corrected few typos #1 1.0.3
      Feature: Live synchronization Enhancement: Load the module only in the backend Enhancement: Documentation improvement 1.0.2
      Bug fix: Various bug fixes and improvements in JS functions Enhancement: Documentation improvement Enhancement: Corrected few typos 1.0.1
      Bug fix: Various bug fixes and improvements in the duplication process 1.0.0
      Initial release Support this module
      If this module is useful for you, I am very thankful for your small donation: Donate 5,- Euro (via PayPal – or an amount of your choice. Thank you!)
      Download this module
      > Github: https://github.com/FlipZoomMedia/InputfieldRepeaterMatrixDuplicate
      > PW module directory: https://modules.processwire.com/modules/inputfield-repeater-matrix-duplicate/
×
×
  • Create New...