PDA

View Full Version : Bug displaying user profile fields?


matt_
01-24-2015, 11:25 AM
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
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:

<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:
<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:
<dd id="profilefield_value_60" class="aboutme_right">Edited 60</dd>


Inspect element of UPF 60 after refresh:
<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.