Levertine

Please login or register.

Author Topic: Bug. Viewing items in IE11  (Read 2282 times)

lurk

  • Full Member
  • ***
  • Posts: 113

Bug. Viewing items in IE11
« on: January 14, 2015, 11:59:24 PM »
Well two problems actually.

1: When I view one of my items in IE11,

This one.
Eagle test pic

there's a huge empty white space between the item (image) and the comments.

2: Not browser related.  My item has one comment made by myself, and for some reason it's showing all my comments under that item

« Last Edit: January 15, 2015, 12:03:54 AM by lurk »
Guitarist Guild Running SMF 2.0.9 / Tinyportal 1.1 and Levertine Gallery

Arantor

  • Levertine Developer
  • Full Member
  • *
  • Posts: 248

Re: Bug. Viewing items in IE11
« Reply #1 on: January 15, 2015, 01:39:15 AM »
1. This is actually a fun bug introduced in the theme itself rather than core LevGal (it's fine on Curve on IE11 for example) and I've fixed it here by fixing the theme, thanks for reporting!

2. Stupid mistake on my part, can't exactly give you the 1.1.0 file since it needs other 1.1.0 code. But I can give you the changes that seem to have fixed it locally. The edits need to be in Sources/levgal_src/Model/Item.php
Code: (find) [Select]
if ($user_info['is_guest'])
{
$clauses[] = empty($session_comments) ? 'approved = {int:approved}' : '(approved = {int:approved} OR id_comment IN ({array_int:session_comments}))';
}
// People who aren't managers/approvers or specifically privileged... can only see their own.
elseif (!allowedTo(array('lgal_manage', 'lgal_approve_comment')) && (!$this->isOwnedByUser() || empty($modSettings['lgal_selfmod_approve_comment'])))
{
$clauses[] = 'approved = {int:approved} OR id_author = {int:user_id}';
}

Code: (replace) [Select]
if ($user_info['is_guest'])
{
$clauses[] = empty($session_comments) ? '(approved = {int:approved})' : '(approved = {int:approved} OR id_comment IN ({array_int:session_comments}))';
}
// People who aren't managers/approvers or specifically privileged... can only see their own.
elseif (!allowedTo(array('lgal_manage', 'lgal_approve_comment')) && (!$this->isOwnedByUser() || empty($modSettings['lgal_selfmod_approve_comment'])))
{
$clauses[] = '(approved = {int:approved} OR id_author = {int:user_id})';
}

Just needs brackets around the clauses where it gets joined with an AND since there's a lot of combinations and I forgot to add brackets to get the order right.

lurk

  • Full Member
  • ***
  • Posts: 113

Re: Bug. Viewing items in IE11
« Reply #2 on: January 15, 2015, 08:02:33 AM »
Thanks for the fix.  ;)

Still a bit confused about the comments side of things though.  Viewing an item that says it has one comment, still shows completely unrelated comments below it.  Comments I made to other items seem to be mixed in. 
Guitarist Guild Running SMF 2.0.9 / Tinyportal 1.1 and Levertine Gallery

Arantor

  • Levertine Developer
  • Full Member
  • *
  • Posts: 248

Re: Bug. Viewing items in IE11
« Reply #3 on: January 15, 2015, 03:40:07 PM »
It's not random.

Here's the deal... that query is crazy complicated, since it has to fetch approved comments, or your comments (regardless of approved), for this item.

What had happened was it was '(this item AND approved) OR yours' when it should have been 'this item AND (approved OR yours)'. Brackets are just as important here as they are in regular maths ;) I'll update here to 1.1 shortly once I've got a few more bits worked out on it like finishing the SMF Packs Multimedia Gallery importer.

maxx

  • Guest
Re: Bug. Viewing items in IE11
« Reply #4 on: January 15, 2015, 07:49:13 PM »
Sorry, I'm late on this but this particular theme has that bug, it also appears in the, the admin section, I had posted the fix for these a few year back before the site disappeared.

I think I have 2 versions plus the custom jobs I did on it! Good theme though!

Arantor

  • Levertine Developer
  • Full Member
  • *
  • Posts: 248

Re: Bug. Viewing items in IE11
« Reply #5 on: January 15, 2015, 07:52:51 PM »
I fixed the admin panel bug already on this theme (since it affected the profile too), this was a slightly different cause rather than the one caused by clearing in the old code.

maxx

  • Guest
Re: Bug. Viewing items in IE11
« Reply #6 on: January 15, 2015, 07:56:37 PM »
Good deal... and thanks!

Why don't I learn how to read... more!

regards,
Maxx

Arantor

  • Levertine Developer
  • Full Member
  • *
  • Posts: 248

Re: Bug. Viewing items in IE11
« Reply #7 on: January 15, 2015, 07:58:05 PM »
It's not obvious that that would be the case, though, it's all good. At first I thought it was the same bug too. Fortunately IE11 comes with useful dev tools these days, so it was a snap to investigate.
 

SMF 2.0.9 | SMF © 2014, Simple Machines
BlueLight design by Bloc