1283 Posts
Bucklash
7 years ago
4
Topic

Hi folks (Klas!!)

Just checking myself here...

So using beforestore/beforerender I can retrieve from 'values' i.ie.

$config['storages']['#__cck_store_form_somecontenttype']->values['some_json_field']['some_value'] = 'stored value';

But am I able to assign values here so that they get stored? Continuing from above example

$config['storages']['#__cck_store_form_somecontenttype']->values['some_json_field']['some_value'] = 'new value';

It seems '$config['storages']['#__cck_...']->values' is for retrieving information, not storing information.

Is that correct?

Jon

Get a Book for SEBLOD
35 Posts
julien
7 years ago
1
Level 1

Hi Bucklash,

I didn't know we can use $config in a BeforeRender code.

I only use $config in a BeforeStore code. To write value in DataBase.

If i want read value in BeforeRender I use $field and if I want write value or read value from an other table I use joomla code.

What is the advantage tu use $config?

Julien

1283 Posts
Bucklash
7 years ago
0
Level 2

Hi

Hi yes you are right, $config not for beforerender, I mentioned that in error.  

I was seeing if I could simply add values to '$config....values' using beforestore but no joy

In a form I am grabbing a load of data, and after a few calculations storing it in to params, and was seeing if values could be used as as away of merging it with existing params.

Interesting that you do Joomla method ...

4229 Posts
Kadministrator
7 years ago
1
Level 1

You should be able to alter values, but you can't add new fields that are not added to content type already

1283 Posts
Bucklash
7 years ago
0
Level 2

Hmm

I will have another go then, at the minute Inhave it working another way.  

Will reply when sorted it. 

Get a Book for SEBLOD