# Updating structure fields on KirbyPanel users

**URL:** <https://forum.getkirby.com/t/updating-structure-fields-on-kirbypanel-users/2733>\
**Category:** Questions\
**Tags:** v2\
**Created:** [December 5, 2015, 1:56am UTC](https://forum.getkirby.com/t/updating-structure-fields-on-kirbypanel-users/2733 "2015-12-05T01:56:59Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![laciel](https://avatars.discourse-cdn.com/v4/letter/l/c89c15/32.png) [@laciel](https://forum.getkirby.com/u/laciel)\
**Post date:** [December 5, 2015, 1:56am UTC](https://forum.getkirby.com/t/updating-structure-fields-on-kirbypanel-users/2733/1 "2015-12-05T01:56:59Z")

</div>

Hi there! I seem to have run into an issue with updating the content within structure fields on the users in my kirby panel

I used the technique described [here](https://forum.getkirby.com/t/add-method-to-append-to-structure-field/494/3), but when i tried to run the yaml() function it caused an error, and if i tried yaml::decode it failed to pass the entire structure, only a portion of it

i have since moved on to MySQL to handle what i needed to accomplish but I figured it was best to also pass this on incase anyone else tries to do the same (probably me in the future!)

also any functions to easily just update individual entries and their child values within the structure would be very nice, not just the ability to add new entries to it. thanks for all your hard work on this fantastic software, a customer for life!

---

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [December 5, 2015, 2:05am UTC](https://forum.getkirby.com/t/updating-structure-fields-on-kirbypanel-users/2733/2 "2015-12-05T02:05:21Z")

</div>

Could you post your code, pls?

---

<div class="post-metadata">

**Author:** ![laciel](https://avatars.discourse-cdn.com/v4/letter/l/c89c15/32.png) [@laciel](https://forum.getkirby.com/u/laciel)\
**Post date:** [December 5, 2015, 2:27am UTC](https://forum.getkirby.com/t/updating-structure-fields-on-kirbypanel-users/2733/3 "2015-12-05T02:27:58Z")

</div>

Yeah! think this was it, i trashed the page i was using but i have a lingering text document that i _believe_ details what was going on here

```php
      <?php foreach(yaml::decode( $site->users()->find('565fd296754fd')->puzzlestats() ) as $stat): ?>
        <div class="address">
          <?php echo $stat['puzzleid'] ?><br />
          <?php echo $stat['puzzlescore'] ?> <?php echo $stat['wins'] ?>
        </div>
    <?php endforeach ?>

```

i was getting jumbled output here for each time i was echoing one of the values in the structure

i copied the exact same structure into a page with a template and tried running the same code with success

i believe this following output was returned by  
`print_r( yaml::decode( $site->users()->find('565fd296754fd')->puzzlestats() ) )`  
(it might’ve been a var\_dump, can’t remember)

> string(170) "- puzzleid: test1 puzzlescore: “1” wins: “1” losses: “2” - puzzleid: test2 puzzlescore: “3” wins: “1” losses: “1” - puzzleid: test3 puzzlescore: “4” wins: “0” losses: “3"”

and this second one was the same implementation on the normal kirby page

> string(197) "- puzzleid: test1 puzzlescore: “1” wins: “1” losses: “2” - puzzleid: test2 puzzlescore: “3” wins: “1” losses: “1” - puzzleid: test3 puzzlescore: “4” wins: “0” losses: “3"” }

like said before, the yaml function did not work on the users page but it did work when used on the normal kirby page

hopefully i’m remembering this all right haha! hopefully something can be done here! and _hopefully_ it wasn’t just me implementing it improperly ;p

thanks!!

---

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [December 5, 2015, 10:39am UTC](https://forum.getkirby.com/t/updating-structure-fields-on-kirbypanel-users/2733/4 "2015-12-05T10:39:14Z")

</div>

I think this is a bug, the `yaml()` and `toStructure()` methods throw an error when used on a structure field in a user blueprint. I’ll create an issue on GitHub.

> <https://github.com/getkirby/kirby/issues/336>

---

<div class="post-metadata">

**Author:** ![laciel](https://avatars.discourse-cdn.com/v4/letter/l/c89c15/32.png) [@laciel](https://forum.getkirby.com/u/laciel)\
**Post date:** [December 5, 2015, 4:17pm UTC](https://forum.getkirby.com/t/updating-structure-fields-on-kirbypanel-users/2733/5 "2015-12-05T16:17:17Z")

</div>

Ah, didn’t know this was related to an already known bug

sweet! guess i’ll be looking forward to it getting fixed 😄

thanks for all your help!

---

<div class="post-metadata">

**Author:** ![distantnative](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/distantnative/32/11319_2.png) [@distantnative](https://forum.getkirby.com/u/distantnative)\
**Post date:** [February 6, 2025, 5:04pm UTC](https://forum.getkirby.com/t/updating-structure-fields-on-kirbypanel-users/2733/6 "2025-02-06T17:04:00Z")

</div>


