Jump to content

Repeater field images not showing on production server


Xonox
 Share

Recommended Posts

Hi,

I have a template that it's working fine in development, however I can't get it to work on production! It shows every information inside repeater fields except the images.

Here's the template:

image.png.770844a1cb4e7c8297b4e16a222f2ec3.png

These are the circuit_day_image settings:

image.png.7adf4d168c8ad2fc7000c8a129695bae.png

This is the code:

<?php
	foreach($page->circuit_days as $circuit_day) {
		if($circuit_day->circuit_day_image) {
			$day_image = $circuit_day->circuit_day_image->size(300, 300)->url;
			echo '<img src="' . $day_image . '" />';
		}
		else {
			echo 'No image! :(';
		}
		echo '<h2>' . $circuit_day->title . '</h2>';
		echo $circuit_day->body;
	}
?>

I always get "No image! :("

I think I'm doing everything right!

Anyone else with a similar problem?

Update

After uploading the production database into my server, the images stopped working. It can be one of two problems:

1. Bad field configuration;

2. Something wrong with the Database.

I can't find the problem. Any suggestion is welcome, thanks,

Update 2

I forgot to upload the images. It's working on dev and not on production. Still no clue!

Clue 1

When I insert

 <pre><?php print_r($circuit_day); ?></pre>

On development I get a clean list for each repetition:

image.png.f0f54398e864bd5033c92b656580b109.png

However, on production, the command gets on a weird recursive loop that takes forever (it even slows the browser to a halt):

image.thumb.png.1e13731ba71a89c12c7028dc1ca0bdad.png

What might be going on?

Link to comment
Share on other sites

Do you have $config->pagefileSecure = true; in your config.php file on the production server?

There are a couple of issues regarding images in repeater fields and profiles, that were just fixed in the last two days. Please see issues #625 and #629 for more information. If this is the same as one of those problems, you can either update to the latest code in the dev tree, or turn off pagefileSecure (if it isn't needed.)

Hope that helps.

Link to comment
Share on other sites

7 minutes ago, netcarver said:

Do you have $config->pagefileSecure = true; in your config.php file on the production server?

There are a couple of issues regarding images in repeater fields and profiles, that were just fixed in the last two days. Please see issues #625 and #629 for more information. If this is the same as one of those problems, you can either update to the latest code in the dev tree, or turn off pagefileSecure (if it isn't needed.)

Hope that helps.

I added $config->pagefileSecure = false; to the config.php and I still couldn't get it to work! Thanks for the suggestion.

Link to comment
Share on other sites

2 minutes ago, flydev said:

And what tell the server logs ? does it show something ? (apache/nginx/php logs)

On the browser dev console, can you see which server response you are getting ? 200, 404, 500 ?

Hi, I did some more experiments and updated the post (see Clue 1). It looks like a PW problem, in my opinion.
I don't get a server response because the image doesn't even tries to be loaded.
Thanks for your suggestion.

Link to comment
Share on other sites

1 minute ago, flydev said:

Which page as example won't get the image on the production site ?  Checking kal**s**l.com on a incognito mode I can't see one issue ?

The page is not online (unpublished), it's a new template.
Everything else is working fine.
I have other repeater fields in place, with images that are working fine (the fade in logo on the homepage comes from a repeater field).
Maybe if I create a new field it will solve the issue.

Link to comment
Share on other sites

You could try that... "ça ne mange pas de pain"

Quote

As it turned out, the issue was with the database. For every repeater item, I deleted the translated text, saved the page, re-entered the text and saved the page again. After that the text magically appeared on the page

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...