This topic was marked solved by Arantor, on February 21st, 2013, 02:26 AM

Auk

  • Can I get a Box?
  • Posts: 64
Codes appearing while viewing some topics.
« on February 11th, 2013, 05:45 AM »
Quote
$(".umme").mime({ 2367: ["pr", "we/http://innovatenotimitate.com/", "po"], 2813: ["pr", "we/http://www.tulsafinds.com/", "po"] }, { pr: ['Profile', 'View user profile', '', 'profile_button'], we: ['Website', 'Go to user\'s website', '%special%', 'www_button'], po: ['View posts', 'View user\'s latest contributions', '?area=showposts', 'post_button'] }, true);
This appears at bottom of some threads when viewing as guest.

http://wedge.org/pub/feats/7905/post-count-permissions/

It may not appear to you, this seems to appear while not logged in (viewing topic as guest.)


Posted: February 11th, 2013, 05:34 AM

Ah, right. This problem occurs regardless of browsers and skin used.
Posted: February 11th, 2013, 05:35 AM

Snooping around, this seems to have something to do with Arantor's profile. Go to the link above where I found the bug, then hover your mouse cursor over his name, you'll then see "Website" which goes to Arantor's website. Do the same for godboko71's name. So this appears to be javascript for that fancy effect. Note that on the bug pages, you don't get that fancy effect.

 Screenshot from 2013-02-10 bug.png - 347.71 kB, 1920x1175, viewed 150 times.


Nothing is more despicable than respect based on fear.

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Re: Codes appearing while viewing some topics.
« Reply #1, on February 11th, 2013, 05:48 AM »
That's... interesting. Weird, but interesting.

Can you view the source for that page and post it here please? I can't reproduce it myself - but I'm suspecting that's because I have permissions for other things.
Quote
Snooping around, this seems to have something to do with Arantor's profile.
Nope.

What's happening is, the code that generates the mini menu over the profile (which includes a given user's website) is being output in a manner in which it should not be. Please provide a copy of the view-source when you see it so I can try and nail down why this code is being output when it shouldn't be.
When we unite against a common enemy that attacks our ethos, it nurtures group solidarity. Trolls are sensational, yes, but we keep everyone honest. | Game Memorial

Auk

  • Can I get a Box?
  • Posts: 64

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Re: Codes appearing while viewing some topics.
« Reply #3, on February 11th, 2013, 05:57 AM »
Ah, thanks :)


OK, so I know what the problem is.

Display.template.php pushes the user menu (umme) to $context['footer_js'], while the other footer JS is pushed via add_js(). Trouble is for guests, and possibly some others, there's nothing being pushed via add_js already - so the script tag to contain it never gets output.

I don't see why Display.template.php can't push the umme and acme code to the footer through add_js, they're all going to be in the same place anyway... either that or footer_js needs to test whether it begins with a <script> and makes sure to add one otherwise.

I need to hit the sack in a minute or so, so I can't test it however... I can see one reason why it isn't added to add_js directly - and that's performance, stuff's being added in a loop. In which case it should go to a temporary variable and then pass that to add_js, would be better than directly injecting into $context['footer_js'] in the cases where there isn't already footer code.

Nao

  • Dadman with a boy
  • Posts: 16,079
Re: Codes appearing while viewing some topics.
« Reply #4, on February 11th, 2013, 09:11 AM »
I actually reproduced the bug locally last night while testing my Register rewrite (I had to log out to test it obviously, and this umme stuff would show up at the end of a Display page.)
I fixed it without committing because I really had plenty of stuff to commit. And still do. And I'm putting the priority on OUAT and TWD this morning. :P

At least I'm relieved to learn that this was introduced only in the latest updates, last night I thought it might have been a long-lived bug, considering I rarely ever log out of my websites...!

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278

Nao

  • Dadman with a boy
  • Posts: 16,079