51 Posts
morhinio
6 years ago
1
Topic

Hello,

I want count the items of a fieldx. I have tried it with a link field and the following code:

count($cck->get('app_links')->value;

DB

<br />:: app_links::1::/ app_links::<br />…

It works fine. Result = 1

But if I tried it with an upload field, I get always 0 as result and the notice

Trying to get property of non-object

count($cck->get('app_docs')->value;

DB

<br />:: app_docs::1::/ app_docs::<br />…

What ist my mistake?

Get a VIP membership
4229 Posts
Kadministrator
6 years ago
0
Level 1

do a var_dump on $cck->get('app_links'), to see which properties are available, with some fields you need to use values not value.

Get a Book for SEBLOD