[4.0] Check if editor save function exists#17942
[4.0] Check if editor save function exists#17942laoneo wants to merge 10 commits intojoomla:4.0-devfrom
Conversation
|
Ping @DGT41 as this involves code removed from the editor and plugins... |
same goes for all the other methods except display and init and getButtons
|
@laoneo check Digital-Peak#5 |
There is no save() anymore
|
@DGT41 I think now we have a BC break here which we probably can avoid with my first suggestion. This code here https://github.com/joomla/joomla-cms/blob/4.0-dev/components/com_content/tmpl/form/edit.php#L35 breaks now in every extension. |
|
I'v reverted the save function and marked it as deprecated, which I think is better than having a BC break here. |
|
@laoneo the methods are deprecated since 3.7 and this is a needed B/C break. EDIT: we can still provide empty function as we're doing in JHtml::behavior, so apps won't crash and burn (though I'm not in favour of doing that) |
|
The function in the editors itself but not on the form field. |
|
Let's deprecate it in 3.8/3.9 and remove it in j4. Let's drag less unneeded baggages... |
|
If you want keep this can you always return |
|
Removed the function as suggested and deprecated the form field function in staging trough pr #17944. Hopefully it will get into 3.8 to have enough time for extension devs to adapt. |
| { | ||
| if (task == 'article.cancel' || document.formvalidator.isValid(document.getElementById('adminForm'))) | ||
| { | ||
| " . $this->form->getField('articletext')->save() . " |
There was a problem hiding this comment.
this is irrelevant to this PR, but since the form already has the class form-validate all this inline script is useless, the core.js covers this case internally
There was a problem hiding this comment.
I'm a bit hesitant to do it in this pr.
|
Is this still needed? I know @DGT41 's did a refactor on tiny at some point towards the end of last year and I've slightly lost track |
|
@wilsonge we already deprecated these methods in 3.x but we still need a pr to actually drop them in 4.0. Will do that later on today |
|
That's what this pr is doing and the deprecation message is added in the pr #17944. Keep in mind, we talk here about the form field and not the editor itself. |
Summary of Changes
I can't save an article on the front end on the current staging branch because of the error:
Call to undefined method Joomla\CMS\Editor\Editor::save()
Testing Instructions
Edit an article on the front end.
Expected result
Article edit form opens and article can be edited.
Actual result
Error is displayed and article can't be edited.