I read nowadays that php filter in any text format disables drupal cache. So if i liked to do some custom php field how could i do without disabling the drupal cache.

For example: i would like to insert a custom form into a custom field. If i do this by using code field then cache will be disabled cos of text format. I know the cache will be disabled after the form will be submitted, but it would be good if form is cached in other cases(like when user doesnt do anything).

Should i use dynamic field with php? Thx

Comments

aspilicious’s picture

Create a custom DS field in code. I removed the php filter stuff anyway in drupal 8 so it's time to learn some new tricks.
Look for tutorials for "hook_ds_fields_info".

mibfire’s picture

:() But, is it true about what i wrote above? I mean "Custom field with php code disables cache" ?

aspilicious’s picture

Personally I don't use php code ever...
It's dangerous and insecure.

So I have no clue if it disabled page caching. But I wouldn't be surprised if it did as it has to perform runtime tasks on each page load.

mibfire’s picture

If you dont use custom php how can you add custom forms(writed in a module) to a node with display suite?

aspilicious’s picture

Create a custom DS field in code. I removed the php filter stuff anyway in drupal 8 so it's time to learn some new tricks.
Look for tutorials for "hook_ds_fields_info".

mibfire’s picture

k, thx

aspilicious’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.