Attached Image Doesnt Show in Post Preview in 3.1

General discussion of development ideas and the approaches taken in the 3.x branch of phpBB. The current feature release of phpBB 3 is 3.3/Proteus.
Forum rules
Please do not post support questions regarding installing, updating, or upgrading phpBB 3.3.x. If you need support for phpBB 3.3.x please visit the 3.3.x Support Forum on phpbb.com.

If you have questions regarding writing extensions please post in Extension Writers Discussion to receive proper guidance from our staff and community.
Alien_Time
Registered User
Posts: 165
Joined: Fri Apr 05, 2013 3:38 am

Attached Image Doesnt Show in Post Preview in 3.1

Post by Alien_Time »

I am not sure if this only happens on my computer, but I noticed that when I attach images in posts and preview them, the image doesnt show. Instead it has a broken image there. It shows fine when I submit the post and in the actual topic after its posted but it always shows broken image in the post "Preview" page only. Here is a screen dump:
broken_attachment.jpg
(714.61 KiB) Downloaded 2144 times
I tested this on google chrome and havent tried it out in other browsers yet. Does this happen to others?

keith10456
Registered User
Posts: 523
Joined: Sat Apr 22, 2006 10:29 pm
Contact:

Re: Attached Image Doesnt Show in Post Preview in 3.1

Post by keith10456 »

I just tested in Chrome (Version 30.0.1599.101) and I have the same problem.

Also, when I attach the image (by dragging) if I don't click "Start Upload" and simply click "Preview", the image doesn't upload - one would expect that it would.

User avatar
DavidIQ
Customisations Team Leader
Customisations Team Leader
Posts: 1904
Joined: Thu Mar 02, 2006 4:29 pm
Location: Earth
Contact:

Re: Attached Image Doesnt Show in Post Preview in 3.1

Post by DavidIQ »

Seems to be working for me though that means it might have something to do with the user type although I wouldn't know why that would be the case... Sounds like a ticket needs to be created. Are you guys waiting for the green checkmark to show up in the upload panel?
Attachments
Uploading_3.1.png
(85 KiB) Downloaded 2123 times
Image

Alien_Time
Registered User
Posts: 165
Joined: Fri Apr 05, 2013 3:38 am

Re: Attached Image Doesnt Show in Post Preview in 3.1

Post by Alien_Time »

keith10456 wrote:Also, when I attach the image (by dragging) if I don't click "Start Upload" and simply click "Preview", the image doesn't upload - one would expect that it would.
Thats right. Its the same when I use the "Add Files" option too. I need to add the file and then need to click on "Start Upload" for it to start uploading. If not it doesnt do that automatically.
DavidIQ wrote:Are you guys waiting for the green checkmark to show up in the upload panel?
Yeah.. The preview is viewed after the upload is completed, if thats what you are asking.

Alien_Time
Registered User
Posts: 165
Joined: Fri Apr 05, 2013 3:38 am

Re: Attached Image Doesnt Show in Post Preview in 3.1

Post by Alien_Time »

I just tested in other browsers, and it doesnt work properly for me there too. These are the results on my computer:

1) Safari version 5.1.7: Nothing happens in Safari. I mean, I upload the file by adding "Add Files". After that I need to manually click on "Start Upload" button to upload it. After I see the checkbox next to it once the upload is completed, when I click preview, the preview page opens without any attachment at all as if no attachment was added to it. So basically I am unable to add attachment from safari. Here is the screen dumps:

Posting Screen after uploading the attachment and before previewing:
safari_before_preview.jpg
(315.68 KiB) Downloaded 2106 times
Preview Screen when preview button is clicked after uploading the attachment. Here I cant see any attachments and it looks as if no attachment was added to it:
safari_after_preview.jpg
(379.87 KiB) Downloaded 2106 times
2) Firefox version 24.0: This is the same as google chrome. I am able to add the attachment but in the preview, the attached image is not showing. Instead it just shows the alt tag in it.
Firefox_attachment.jpg
(347.58 KiB) Downloaded 2106 times
3) IE 10: In IE, the link for Add files button itself doesnt work. When I click on 'Add Files', the page goes to the top (as if I am clicking on an anchor tag that takes you to the top of the page). Thats it. It doesnt do anything else in this and I cannot upload file here.

User avatar
DavidIQ
Customisations Team Leader
Customisations Team Leader
Posts: 1904
Joined: Thu Mar 02, 2006 4:29 pm
Location: Earth
Contact:

Re: Attached Image Doesnt Show in Post Preview in 3.1

Post by DavidIQ »

Alien_Time wrote:3) IE 10: In IE, the link for Add files button itself doesnt work. When I click on 'Add Files', the page goes to the top (as if I am clicking on an anchor tag that takes you to the top of the page). Thats it. It doesnt do anything else in this and I cannot upload file here.
I'm on IE 11 and got the select file dialog. Are you getting any javascript errors (double-click bottom left of browser or turn on either script debugging or show notification on every script error)?
Image

Alien_Time
Registered User
Posts: 165
Joined: Fri Apr 05, 2013 3:38 am

Re: Attached Image Doesnt Show in Post Preview in 3.1

Post by Alien_Time »

When I turned on script debugging in IE10, I get this error for this line:

Code: Select all

if (form[i].name.indexOf('attachment_data[') !== 0) 
Error:

Code: Select all

SCRIPT5007: Unable to get property 'indexOf' of undefined or null reference 
plupload.js, line 73 character 3

User avatar
DavidIQ
Customisations Team Leader
Customisations Team Leader
Posts: 1904
Joined: Thu Mar 02, 2006 4:29 pm
Location: Earth
Contact:

Re: Attached Image Doesnt Show in Post Preview in 3.1

Post by DavidIQ »

Image

Alien_Time
Registered User
Posts: 165
Joined: Fri Apr 05, 2013 3:38 am

Re: Attached Image Doesnt Show in Post Preview in 3.1

Post by Alien_Time »

HI David, I looked at that link and I dont understand what the solution in the end was. So is this a bug? I tested this from google chrome console and I receive this:

Code: Select all

Resource interpreted as Image but transferred with MIME type text/html: "https://area51.phpbb.com/phpBB/download/file.php?id=2453". posting.php:203
When I searched more on this SCRIPT5007: Unable to get property 'indexOf' of undefined or null reference error, some says that the Libraries seem to be the main culprit of these bugs. Some of the solutions for this is:
1.Use a library like jQuery (or similar) which supplies an .inArray() method that you can use instead.

You'll then need to change your code from using var.indexOf(x) to $.inArray(var,x)

Pick this solution if you're already using jQuery (or another library that has this feature).

2. Use a polyfill library like this one that adds the standard .indexOf method to the Array prototype.

This should allow you to keep your existing code unchanged; just include the library.

Use this solution if you are happy to use a library but you haven't got one already installed that would help.

3. Write your own function that does the same job using a for() loop.

This is a complete change in how you find things in your arrays, but does mean you don't need to use any extra libraries.

Use this solution if you don't want to (or can't, for whatever reason) use a third-party library.

4. Remove your IE8 meta tag (it's pretty bad anyway, so that's a good idea) and only support your site for users with IE9 or better.

Use this solution if you're happy to stop supporting older IE versions.

In fact, it would be a good idea to do this anyway; there's no good reason to be using the meta tag to force IE into compatibility mode. Better to set it to content="IE=edge". That will remove the problem entirely for newer IE versions. If you do need to support IE8 or earlier, then this solution won't solve the problem and you'll need to also use one of the other solutions above, but I'd still recommend doing it anyway, because as things stand you are deliberately removing features from newer IE versions for no good reason.
REF: http://stackoverflow.com/questions/1678 ... ull-or-und

http://stackoverflow.com/questions/5787 ... ty-ui-obje

User avatar
prototech
Former Team Member
Posts: 53
Joined: Mon Mar 12, 2007 12:25 am

Re: Attached Image Doesnt Show in Post Preview in 3.1

Post by prototech »

This is fixed in Git now. See http://tracker.phpbb.com/browse/PHPBB3-11986 for details.

Post Reply