Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 01-24-2015, 11:25 AM
matt_ matt_ is offline
 
Join Date: Feb 2008
Location: London
Posts: 2
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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?
Reply With Quote
  #2  
Old 01-25-2015, 10:34 PM
ozzy47's Avatar
ozzy47 ozzy47 is offline
 
Join Date: Jul 2009
Location: USA
Posts: 10,929
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Can you give step by stem instructions as to what you are doing, so I can try to replicate that.
Reply With Quote
  #3  
Old 02-01-2015, 11:22 AM
matt_ matt_ is offline
 
Join Date: Feb 2008
Location: London
Posts: 2
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Attached Images
File Type: jpg 1 Edit UPF 59, 60 shows XXX.JPG (14.2 KB, 0 views)
File Type: jpg 2 Edited 59 OK, 60 shows XXX.JPG (12.6 KB, 0 views)
File Type: jpg 3 Edit UPF 60.JPG (14.5 KB, 0 views)
File Type: jpg 4 Edited 60 not showing XXX.JPG (11.9 KB, 0 views)
File Type: jpg 5 Page refresh correctly shows XXX.JPG (11.9 KB, 0 views)
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 11:31 AM.


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.04056 seconds
  • Memory Usage 2,221KB
  • Queries Executed 14 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (3)bbcode_html
  • (1)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (3)post_thanks_box
  • (3)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (3)post_thanks_postbit_info
  • (3)postbit
  • (5)postbit_attachment
  • (3)postbit_onlinestatus
  • (3)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • postbit_attachment
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete