Notifications
Clear all

[Solved] Revoking attachment permissions to 'Read only' access breaks post layout for non-logged in users + solution

7 Posts
2 Users
0 Reactions
916 Views
Posts: 34
 fawp
Topic starter
(@fawp)
Trusted Member
Joined: 5 years ago

Hi guys

 

First off, I don't know if this has been fixed for Advanced Attachments for wpForo 2.x as I have yet to purchase that product.

 

This is related to the following thread which is now closed

https://gvectors.com/forum/wpforo-advanced-attachments/2-questions-3/

 

Issue

For non-logged in users, if I uncheck the "Can view attached files" checkbox in the Read only access, any non-logged in user will see a broken post layout.

 

The culprit appears to be this piece of code

version: 2.0.8

File: wpforo-advanced-attachments/includes/class.wpForoAttachmentsTools.php

Line: 222

Code:

$attach_html .= '<br/><div class="wpfa-item wpfa-file"><a class="attach_cant_view" style="cursor:pointer;"><span style="color:#666;">' . wpforo_phrase('Attachment', FALSE) . ':</span> ' . urldecode( basename($filename) ) . '</a></div>';

 

Solution

By adding a space between color: and #666 the issue disappears.

Topic Tags
6 Replies
Kyle
Posts: 728
 Kyle
(@kylew)
Prominent Member
Joined: 3 years ago

Hi @fawp,

Advanced Attachments doesn't have that issue, Non-Logged-in users with Read only access(Can view attached files- disabled) see the attachments the same as in the below Screenshot

wpforo disabe attached file view

 

1 Reply
 fawp
(@fawp)
Joined: 5 years ago

Trusted Member
Posts: 34

@kylew Thanks Kyle,

 

Well, this is the HTML markup being generated

wpf ad at

 

As you can see, the markup somehow is broken. But, by making that small change, the markup is no longer broken.

 

I am not necessarily suggesting it is a problem that affects everybody, but it seems to be affecting some users (e.g. me and the other guy who posted the original topic above)

Posts: 34
 fawp
Topic starter
(@fawp)
Trusted Member
Joined: 5 years ago

@kylew I have just noticed that the Topic Starter in the original topic

https://gvectors.com/forum/wpforo-advanced-attachments/2-questions-3/

 

mentioned the same version for Advanced Attachment as me, which is version: 2.0.8.

 

He also says when he updated the plugin with a newer version the problem disappeared.

 

Is it possible this situation was captured and resolved in a newer version?

1 Reply
Kyle
 Kyle
(@kylew)
Joined: 3 years ago

Prominent Member
Posts: 728

@fawp,

Yes, after 2.0.8 has been released 2.1.1 with CSS fixes.

Changelog 2.1.1

  • Improvement: Performance improvement
  • Fixed bug: 404 error “File is not found” when “Secure URLs” is enabled and the file name contains non-Latin chars
  • Fixed bug: Proper clearing attachment shortcodes in unnecessary places (widgets, activity stream, etc…)
  • Fixed bug: CSS Issues
  • Fixed bug: Incorrect displaying of “Allowed max size”next to the attachment button
Posts: 34
 fawp
Topic starter
(@fawp)
Trusted Member
Joined: 5 years ago

Update: the solution above needs to be applied to line 174 as well as line 222

Posts: 34
 fawp
Topic starter
(@fawp)
Trusted Member
Joined: 5 years ago

I just checked in my archives - I had not realized that I had also wpforo-advanced-attachments-2.1.1 and this issue appears to have been fixed in that version: the problem above has been corrected in there and the space is correctly inserted between color: and #666

Share:
Scroll to top