# Problem with trying to retrieve fields from a User

**URL:** <https://forum.getkirby.com/t/problem-with-trying-to-retrieve-fields-from-a-user/4964>\
**Category:** Questions\
**Tags:** v2\
**Created:** [August 12, 2016, 4:10pm UTC](https://forum.getkirby.com/t/problem-with-trying-to-retrieve-fields-from-a-user/4964 "2016-08-12T16:10:13Z")\
**Posts on this page:** 13\
**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:** [August 12, 2016, 4:10pm UTC](https://forum.getkirby.com/t/problem-with-trying-to-retrieve-fields-from-a-user/4964/1 "2016-08-12T16:10:13Z")

</div>

Hello all, been struggling with handling the users() collection recently, I can’t seem to return anything other than the username and avatar of a user. When I try to call -\>firstName() or any other custom field, or try to run a filterBy(‘role’, ‘xxx’), PHP throws some fatal errors at me.

I’ve seen these two errors come up:

`Undefined offset: 2 line	274 code 8 file	/kirby/toolkit/lib/collection.php`

and

`Call to undefined method Data::read() in /kirby/core/user.php on line 46`

Anyone know what’s happening here? Any help would be much, much appreciated, 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:** [August 12, 2016, 4:31pm UTC](https://forum.getkirby.com/t/problem-with-trying-to-retrieve-fields-from-a-user/4964/2 "2016-08-12T16:31:02Z")

</div>

Have you recently updated your installation? Looks like there’s something missing …

---

<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:** [August 12, 2016, 4:33pm UTC](https://forum.getkirby.com/t/problem-with-trying-to-retrieve-fields-from-a-user/4964/3 "2016-08-12T16:33:25Z")

</div>

Last night I tried replacing the kirby and panel folders from both Github, and the starterkit zip located on this website

Still to no avail :\ I can try again! Thanks for the super quick response, Kirby’s support team is something else!!

---

<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:** [August 12, 2016, 4:36pm UTC](https://forum.getkirby.com/t/problem-with-trying-to-retrieve-fields-from-a-user/4964/4 "2016-08-12T16:36:03Z")

</div>

Make sure to also update the toolkit!

---

<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:** [August 12, 2016, 4:48pm UTC](https://forum.getkirby.com/t/problem-with-trying-to-retrieve-fields-from-a-user/4964/5 "2016-08-12T16:48:30Z")

</div>

Yep, still same problem :\

I made sure it was the latest kirby, and also made sure to download the toolkit separately and I put it in the kirby folder

Really scratchin’ my head here!

Here’s the code I’m using:

> ```
> <?php foreach($site->users() as $account): ?>
> 
> ```

```
      <li>
        <a href="#">
          <?php if( $account->avatar() ): ?>
            <img src="<?php echo $account->avatar()->resize(200)->url() ?>">
          <?php endif ?>
        </a>
        <p><?php echo $site->user('laciel')->firstName() ?></p>
      </li>
  <?php endforeach ?>

```

The avatar() function works fine, but practically everything else throws me a fatal error

Thanks for all your help thus far!

---

<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:** [August 12, 2016, 4:58pm UTC](https://forum.getkirby.com/t/problem-with-trying-to-retrieve-fields-from-a-user/4964/6 "2016-08-12T16:58:03Z")

</div>

Hm, there’s nothing wrong with that code, I just threw it at my test install and everything is fine, apart from the firstName throwing an error because I don’t have a user called ‘laciel’.

Can you test with a fresh starterkit?

What is your environment (Server, PHP version)?

---

<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:** [August 12, 2016, 5:00pm UTC](https://forum.getkirby.com/t/problem-with-trying-to-retrieve-fields-from-a-user/4964/7 "2016-08-12T17:00:24Z")

</div>

Alright, I’ll try with a fresh starterkit!

And I’m running it on a MAMP server on my home machine, PHP version 5.6.10

I’ll let you know how it goes!

---

<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:** [August 12, 2016, 5:09pm UTC](https://forum.getkirby.com/t/problem-with-trying-to-retrieve-fields-from-a-user/4964/8 "2016-08-12T17:09:16Z")

</div>

Alright, definitely strange! It works fine on a fresh starterkit. So what could even possibly be causing this issue on my other website? What a strange situation!

---

<div class="post-metadata">

**Author:** ![lukasbestle](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/lukasbestle/32/11437_2.png) [@lukasbestle](https://forum.getkirby.com/u/lukasbestle)\
**Post date:** [August 12, 2016, 5:52pm UTC](https://forum.getkirby.com/t/problem-with-trying-to-retrieve-fields-from-a-user/4964/9 "2016-08-12T17:52:59Z")

</div>

It’s strange that you get the “Call to undefined method Data::read()” error, because that means that somehow the Toolkit is not loaded correctly.

---

<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:** [August 12, 2016, 5:59pm UTC](https://forum.getkirby.com/t/problem-with-trying-to-retrieve-fields-from-a-user/4964/10 "2016-08-12T17:59:02Z")

</div>

Actually, I just figured it out!

It seems that there’s been conflict with this: [https://codecanyon.net/item/slider-revolution-responsive-jquery-plugin/2580848](https://codecanyon.net/item/slider-revolution-responsive-jquery-plugin/2580848)

Because after I commented out its “embed.php” file that needed to be included, everything worked as it should!

Any ideas on what I could do to fix those conflicts? It would be nice to be able to use this plugin!

---

<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:** [August 12, 2016, 6:05pm UTC](https://forum.getkirby.com/t/problem-with-trying-to-retrieve-fields-from-a-user/4964/11 "2016-08-12T18:05:57Z")

</div>

What sort of an embed file is that? I’m a bit surprised that needs more than js and css files?

[https://www.themepunch.com/revsliderjquery-doc/get-started/](https://www.themepunch.com/revsliderjquery-doc/get-started/)

---

<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:** [August 12, 2016, 6:09pm UTC](https://forum.getkirby.com/t/problem-with-trying-to-retrieve-fields-from-a-user/4964/12 "2016-08-12T18:09:34Z")

</div>

My bad, it’s for the front-end editor to make the slideshows!

> **[Slider Revolution jQuery Visual Editor Addon](https://codecanyon.net/item/slider-revolution-jquery-visual-editor-addon/13934907)**
>
> Slider Revolution jQuery Visual Editor Addon
> Are you looking to utilize the full visual editing power of our Slider Revolution Responsive WordPress Plugin WITHOUT using WordPress?If you don’t have...

Documentation: [https://www.themepunch.com/revslider-se-doc/slider-revolution-standalone-editor-documentation/](https://www.themepunch.com/revslider-se-doc/slider-revolution-standalone-editor-documentation/)

---

<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, 4:57pm UTC](https://forum.getkirby.com/t/problem-with-trying-to-retrieve-fields-from-a-user/4964/13 "2025-02-06T16:57:21Z")

</div>

Archived on February 6, 2025, 4:57pm UTC


