User tests: Successful: Unsuccessful:
Pull Request for Issue #24631 .
added a check to prevent to save too large module content > 65535
an error message is displayed that you are not permitted to save too large content
no check
Status | New | ⇒ | Pending |
Category | ⇒ | Administration com_modules Language & Strings |
Labels |
Added:
?
?
|
Category | Administration com_modules Language & Strings | ⇒ | Administration com_modules Language & Strings Libraries |
Category | Administration com_modules Language & Strings Libraries | ⇒ | Administration Language & Strings Libraries |
@franz-wohlkoenig feel free to do it
Just tested it. I'm out of my depth in this part of Joomla, but should it not be $data[content] instead of $this->content ? (the $this object does not seem to contain the submitted data)
Also, note that if you add an editor field type in your module, then it does not use the content field, but saves it as part of a json string in the params field with the rest of the data. Only customContent seems to use the content field.
The failure in $data[content] isn't actually as bad - it's the broken json string in params which causes a fatal error.
well i've only experienced with content
.... btw added the check on params
too
please re-test
$this->content and $this->params always seem to return a length of zero.
It feels like -
if ((strlen($this->content) > 65535) || (strlen($this->params) > 65535))
Should be something like -
if ((strlen($data[content]) > 65535) || (strlen(json_encode($data[params])) > 65535))
The latter works on my test, but I'm not sure how tidy my code is.
can you post the zip of your module please
t feels like -
if ((strlen($this->content) > 65535) || (strlen($this->params) > 65535))
Should be something like -
if ((strlen($data[content]) > 65535) || (strlen(json_encode($data[params])) > 65535))
Make sure you're editing the right file. In the table's check()
method, the properties are bound to the class before it is called so $this->foo
should be what you're using in that context.
If you're having to check $data['foo']
then you might be editing the wrong file.
Apologies. I was indeed editing the wrong file.
The bug is now fixed - good work!
@ricomonkeon please mark your test in Issue Tracker as successfully > https://docs.joomla.org/Testing_Joomla!_patches#Recording_test_results
2 questions.
params would be such column but it seams that it isn't used by devs for there needs, why don't they use it and would a new column dedicated for easy use better?
and btw. this is a real bad user experience if you edit something and the system tells you I can't save it without any help how to solve it. Especially when extensions are abusing this field and fill it with json data that isn't seen or can't be modified by the user.
both field content
and params
are declared as text
https://github.com/joomla/joomla-cms/blob/staging/installation/sql/mysql/joomla.sql#L1498
https://github.com/joomla/joomla-cms/blob/staging/installation/sql/mysql/joomla.sql#L1509
so 65,535 characters should be the max length allowed iirc
the goal of this pr is really simple: only to prevent data truncation, it's only a band-aid
not a schema redesign nor a complete review of Exception flows as correctly Michael pointed out #24635 (comment)
sorry about the mediumtext, the first website I checked had it as mediumtext and I don't know why.
ok then I understand thx.
I have tested this item
I have tested this item
@HLeithner set this on RTC or retest of @ricomonkeon needed?
No need to retest. We just need to get appveyor running. Let me reboot him
Status | Pending | ⇒ | Ready to Commit |
Status "Ready To Commit".
Status | Ready to Commit | ⇒ | Fixed in Code Base |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2019-04-20 13:25:03 |
Closed_By | ⇒ | HLeithner | |
Labels |
Added:
?
|
But why text limitations? I have 60+ Speakers attending the conference, and I want to use as a module in multiple paces.
@ricomonkeon please test.