vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   Bug displaying user profile fields? (https://vborg.vbsupport.ru/showthread.php?t=316887)

matt_ 01-24-2015 11:25 AM

Bug displaying user profile fields?
 
We're running 4.2.2 and have added some user profile fields, following the excellent tutorial by Lynne https://vborg.vbsupport.ru/showthread.php?t=250418

We modified the template to suit our content but we think we've discovered a bug when a user profile field is edited, affecting all user profile fields.

During display, template modifications are respected. When you edit (using Ajax) and save, the updated field is re-displayed, however vB ignores the template.

Anyone else found this?

ozzy47 01-25-2015 10:34 PM

Can you give step by stem instructions as to what you are doing, so I can try to replicate that.

matt_ 02-01-2015 11:22 AM

1 Attachment(s)
We've decided to drop the functionality we wanted, but here's an example:

Create a couple of single-line textbox userfields, IDs 59 and 60.

Modify memberinfo_profilefield, adding vb:if condition to userfield 60:

PHP Code:

<vb:if condition="$show['profilefield_edit']">
    <
dl>
    <
dt id="profilefield_title_{vb:raw profilefield.profilefieldid}" class="aboutme_left">{vb:raw profilefield.title}</dt>
    <
dd id="profilefield_value_{vb:raw profilefield.profilefieldid}" class="aboutme_right">
    <
vb:if condition="$profilefield[profilefieldid] == 60">
        
XXX: {vb:raw profilefield.value}
    <
vb:else />
        {
vb:raw profilefield.value}
    </
vb:if>
    <
script type="text/javascript">
    <!--
    
vBulletin.register_control("vB_ProfilefieldEditor""{vb:raw profilefield.profilefieldid}");
    
//-->
    
</script>
    </
dd>
<
vb:else />
    <
dl class="stats agerow">
    <
dt>{vb:raw profilefield.title}</dt>
    <
vb:if condition="$profilefield[profilefieldid] == 60">
        <
dd>XXX: {vb:raw profilefield.value}</dd>
    <
vb:else />
        <
dd>{vb:raw profilefield.value}</dd>
    </
vb:if>
</
vb:if>
</
dl

Attachments 1-5 shows editing UPF 59 and 60, after 60 is edited the XXX isn't shown but when the page is refreshed, the XXX shows again.


Inspect element of UPF 60 on display:
HTML Code:

<dd id="profilefield_value_60" class="aboutme_right">
       
                XXX: N/A
       
        <script type="text/javascript">
        <!--
        vBulletin.register_control("vB_ProfilefieldEditor", "60");
        //-->

        </script>
        </dd>


Inspect element of UPF 60 after edit:
HTML Code:

<dd id="profilefield_value_60" class="aboutme_right">Edited 60</dd>

Inspect element of UPF 60 after refresh:
HTML Code:

<dd id="profilefield_value_60" class="aboutme_right">
       
                XXX: Edited 60
       
        <script type="text/javascript">
        <!--
        vBulletin.register_control("vB_ProfilefieldEditor", "60");
        //-->

        </script>
        </dd>

It looks like VB reverts to a standard field display template after Ajax edit, ignoring the modified template.


All times are GMT. The time now is 10:02 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01008 seconds
  • Memory Usage 1,736KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (3)bbcode_html_printable
  • (1)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (3)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete