HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Please upgrade here. These earlier versions are no longer being updated and have security issues.

Bad: Again Strange Profile Page

KunalKunal
edited June 2012 in Vanilla 2.0 - 2.8

The issue was resolved. But not for all profiles. See this image

Elements are being showed multiple times. The issue is not theme specific. It is with all the themes & for limited profiles. All plugins are deactivated except vanilla embed.

Embeded URL: http://edgeineersclub.com/
Actual URL: http://edgeineersclub.com/developers

Please help me out :-(

Best Answers

  • x00x00 MVP
    edited June 2012 Accepted Answer

    ultimateki's profile is fine, can you show an example? From you description, it sounds more like a caching issue.

    I would rule out first javascript insertion issues, as assets are often fetched and rendered in place, if there is two element with the same class jquery will gladly do what it is told.

    grep is your friend.

    UnderDogKunal
  • x00x00 MVP
    edited June 2012 Accepted Answer

    yes it is a javascipt related as suspected.

    it is to do with the counts, note how the count of discussion that is where the content is inserting splitting the button up.

    I note it is fetching
    http://edgeineersclub.com/developers/profile/17/Sample-User?DeliveryType=VIEW

    It shouldn't be doing anything with these, note there is no reference to delivery method, i.e. JSON, BOOL, it just the in place view.

    So putting my investigative hat on, the problem lies in the fact that the span where the counts are places in have the class Popin, which is reserved in use on global.js, Shown here

       $.fn.popin = function(options) {
          var settings = $.extend({}, options);
          
          this.each(function(i, elem) {
             var url = $(elem).attr('rel');
             var $elem = $(elem);
             $.ajax({
                url: gdn.url(url),
                data: {DeliveryType: 'VIEW'},
                success: function(data) {
                   $elem.html(data);
                },
                complete: function() {
                   $elem.removeClass('Progress TinyProgress');
                   if (settings.complete != undefined) {
                      settings.complete($elem);
                   }
                }
             });
         });
       };
       $('.Popin').popin();
    

    in the other users' profiles these span does not have this class or the rel attribute

    grep is your friend.

    UnderDogKunal
  • x00x00 MVP
    Accepted Answer

    I grep'd popin and in is not in the core that it should be there...

    grep is your friend.

    Kunal
  • x00x00 MVP
    edited June 2012 Accepted Answer

    only function.render calls CancatSep with Popin TinyProgress

    grep is your friend.

    UnderDogKunal
  • x00x00 MVP
    Accepted Answer

    The isssue is not changing js, it is that the Class Popin is used.

    grep is your friend.

    Kunal
  • x00x00 MVP
    edited June 2012 Accepted Answer

    yes it is told to do that the function CountString in functions.render.php inserts Popin TinyProgress in the class.

    inside

          if ($Number === NULL && $Url) {
             $CssClass = ConcatSep(' ', $CssClass, 'Popin TinyProgress');
    

    note the count must be NULL for this to be inserted.

    see in applications/vanilla/settings/class.hooks.php

    ...CountString(GetValueR('User.CountDiscussions', $Sender, NULL...

    and

    ...CountString(GetValueR('User.CountComments', $Sender, NULL)...

    I suspect in the database. the default value for CountComments, and CountDiscussions in the Gdn_User is set to NULL rather than 0, it is int(11) type, should have a default of 0. This would be a quick way to fix, to change the column default for that, and not null.

    If that doesn't work you can change the default of GetValueR like so CountString(GetValueR('User.CountComments', $Sender, '0') and also for CountDiscussions, but given that is is largely working for most, it is preferable to change the data at source as well.

    grep is your friend.

    UnderDogKunal
  • x00x00 MVP
    edited June 2012 Accepted Answer

    did you load you data from a dump? It can sometimes happen that the table spec is not 100% perfect.

    grep is your friend.

    UnderDogKunal
«1

Answers

  • 422422 Developer MVP
    edited June 2012

    Why are you posting multiple threads.

    No one can assist unless you post test user details.

    Get firebug.

  • That thread was displaying "Answered". That is why I posted this one.

    Username: Testing
    Password: 123123

    I have firebug.

  • UnderDogUnderDog Moderator

    Kunal said:
    That thread was displaying "Answered". That is why I posted this one.

    First of all, in that thread you mentioned that your problem was solved. Second. When someone 'answers' you in a thread, then it automatically gets displayed as answered. I also marked that thread as 'Solved'.
    So now you have a new, thesame, problem right?

    See screenshot. Looks ok, unembedded.

  • 422422 Developer MVP

    Tried, gave up, kept getting bonk. I suspect you have cocked something up. Disable ALL plugins, turn error reporting on.

    UnderDog
  • UnderDogUnderDog Moderator

    I think we were logged in at the same time. I cannot even reproduce the page from the screenshot. Profiles with spaces in them don't work nicely in embedded mode.
    Seems purely a CSS issue. Suggest you look at the HTML source with firebug and figure out how you can solve it.
    Unembedded looks fine in FireFox.

  • @UnderDog.... The error appears randomly in profiles. Check the profile of "testing".
    @422.... I have never seen bonk error. How is it coming there?

  • I have observed that latest profiles are showing this error. After a certain period of time, the error is itself fixed.

  • UnderDogUnderDog Moderator

    UnderDog said:
    Seems purely a CSS issue. Suggest you look at the HTML source with firebug and figure out how you can solve it.

  • KunalKunal
    edited June 2012

    This is not a CSS issue. When I make a profile, it is loading strange. To fix it, I have to activate another theme, reload profile and then change back the theme to its default. After doing this, the issue is resolved for the profile. CSS is still the same. It should be a configuration error. If you don't believe, make an account on my website and I'll fix it using this procedure.

    Master
  • x00x00 MVP
    edited June 2012 Accepted Answer

    ultimateki's profile is fine, can you show an example? From you description, it sounds more like a caching issue.

    I would rule out first javascript insertion issues, as assets are often fetched and rendered in place, if there is two element with the same class jquery will gladly do what it is told.

    grep is your friend.

    UnderDogKunal
  • KunalKunal
    edited June 2012

    @x00 Thanks for your quick response.

    Check the profile by clicking the link below.

    http://edgeineersclub.com/developers/profile/17/Sample-User

    You may view the profile from embed page from

    http://edgeineersclub.com/edge-club.php

    You can log in through this account as

    Username: Sample-User
    Password: 123123

  • x00x00 MVP
    edited June 2012 Accepted Answer

    yes it is a javascipt related as suspected.

    it is to do with the counts, note how the count of discussion that is where the content is inserting splitting the button up.

    I note it is fetching
    http://edgeineersclub.com/developers/profile/17/Sample-User?DeliveryType=VIEW

    It shouldn't be doing anything with these, note there is no reference to delivery method, i.e. JSON, BOOL, it just the in place view.

    So putting my investigative hat on, the problem lies in the fact that the span where the counts are places in have the class Popin, which is reserved in use on global.js, Shown here

       $.fn.popin = function(options) {
          var settings = $.extend({}, options);
          
          this.each(function(i, elem) {
             var url = $(elem).attr('rel');
             var $elem = $(elem);
             $.ajax({
                url: gdn.url(url),
                data: {DeliveryType: 'VIEW'},
                success: function(data) {
                   $elem.html(data);
                },
                complete: function() {
                   $elem.removeClass('Progress TinyProgress');
                   if (settings.complete != undefined) {
                      settings.complete($elem);
                   }
                }
             });
         });
       };
       $('.Popin').popin();
    

    in the other users' profiles these span does not have this class or the rel attribute

    grep is your friend.

    UnderDogKunal
  • x00x00 MVP
    Accepted Answer

    I grep'd popin and in is not in the core that it should be there...

    grep is your friend.

    Kunal
  • I have not touched any JS file, then why the issue is there? And please tell me step by step procedure to fix the bug as I am a non technical person in JS & PHP.

    Thanks you so much.

  • x00x00 MVP
    edited June 2012 Accepted Answer

    only function.render calls CancatSep with Popin TinyProgress

    grep is your friend.

    UnderDogKunal
  • Which code to remove, & from where?

  • x00x00 MVP
    Accepted Answer

    The isssue is not changing js, it is that the Class Popin is used.

    grep is your friend.

    Kunal
  • How can I do that? Please tell me that file & code which is required to be changed.

  • x00x00 MVP
    edited June 2012 Accepted Answer

    yes it is told to do that the function CountString in functions.render.php inserts Popin TinyProgress in the class.

    inside

          if ($Number === NULL && $Url) {
             $CssClass = ConcatSep(' ', $CssClass, 'Popin TinyProgress');
    

    note the count must be NULL for this to be inserted.

    see in applications/vanilla/settings/class.hooks.php

    ...CountString(GetValueR('User.CountDiscussions', $Sender, NULL...

    and

    ...CountString(GetValueR('User.CountComments', $Sender, NULL)...

    I suspect in the database. the default value for CountComments, and CountDiscussions in the Gdn_User is set to NULL rather than 0, it is int(11) type, should have a default of 0. This would be a quick way to fix, to change the column default for that, and not null.

    If that doesn't work you can change the default of GetValueR like so CountString(GetValueR('User.CountComments', $Sender, '0') and also for CountDiscussions, but given that is is largely working for most, it is preferable to change the data at source as well.

    grep is your friend.

    UnderDogKunal
  • x00x00 MVP
    edited June 2012 Accepted Answer

    did you load you data from a dump? It can sometimes happen that the table spec is not 100% perfect.

    grep is your friend.

    UnderDogKunal
Sign In or Register to comment.