User tests: Successful: Unsuccessful:
When opening a user's page with an article and any custom field. This same field is rendered 2 times. I repeat. One field in the article is rendered 2 times. This issue has been studied. When the field is rendered 2 times, only 1 result is shown on the site, and 2 render result is meaningless. At the same time, All subscriptions of render events called by the dispatcher are also executed 2 times. Thus, it is not possible to write a user data handler without using crutches and props to avoid double processing of the field object.
For example, if you develop a new field with processing data from forms received from the user. Then such data processing needs to be subscribed to the plugin method
PlgFieldsNewForm->onCustomFieldsPrepareField($context, $item, $field)
But this method will be called 2 times.
My correction allows you to make 1 render for one field call. While maintaining backward compatibility.
This correction does not matter for static data output. But this amendment is of great importance for the output of dynamic data in user fields of articles. This can be useful when creating a complex graph field with a lot of data in one field. Or a feedback field. But in order for feedback to work in a complex field, it is required to render exactly as many times as it will be displayed on the site.
Status | New | ⇒ | Pending |
Category | ⇒ | Unit Tests Repository Administration com_admin SQL Postgresql |
Status | Pending | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2022-04-03 20:30:20 |
Closed_By | ⇒ | korenevskiy | |
Labels |
Added:
?
?
|