Compare commits
8 Commits
Author | SHA1 | Date | |
---|---|---|---|
5beb07c1b4 | |||
3082708867 | |||
236de3634d | |||
f5825caa08 | |||
b3156128c6 | |||
56eb30d08f | |||
b6353b55f3 | |||
d7c9661043 |
32
Moving from J to Namespace.md
Normal file
32
Moving from J to Namespace.md
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
## Class map in J3:
|
||||||
|
|
||||||
|
[https://github.com/joomla/joomla-cms/blob/3.10.12/libraries/classmap.php]
|
||||||
|
|
||||||
|
## Class map in J5:
|
||||||
|
|
||||||
|
[https://github.com/joomla/joomla-cms/blob/5.0-dev/plugins/behaviour/compat/src/classmap/classmap.php]
|
||||||
|
|
||||||
|
## How to handle Classes that have no new counterparts like:
|
||||||
|
|
||||||
|
### JError
|
||||||
|
- JError::raiseError() should be replaced with native exceptions.
|
||||||
|
- JError::raiseWarning() and JError::raiseNotice should be replaced with calls to application's enqueueMessage() method to display warnings/notices.
|
||||||
|
|
||||||
|
This would mean you wrap your code in a try catch block and return the error. Someting like this:
|
||||||
|
```
|
||||||
|
try {
|
||||||
|
// Your code here;
|
||||||
|
} catch (\RuntimeException $e) {
|
||||||
|
throw new \Exception($e->getMessage(), 500, $e);
|
||||||
|
}
|
||||||
|
```
|
||||||
|
Or you would manually report an error back like this:
|
||||||
|
```
|
||||||
|
throw new \Exception(Text::_('Your error message here'), 500);
|
||||||
|
```
|
||||||
|
|
||||||
|
## More info on backwards compatible issues:
|
||||||
|
[https://docs.joomla.org/Potential_backward_compatibility_issues_in_Joomla_4]
|
||||||
|
|
||||||
|
## Deprecated JFactory::getDBO(); alternative
|
||||||
|
[https://github.com/joomla/joomla-cms/discussions/38111#discussioncomment-3971334]
|
8
datetime.md
Normal file
8
datetime.md
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
## DateTime in Mysql JCB Settings
|
||||||
|
In Joomla 3 we were used to setting the default for a datetime field to 0000-00-00 00:00:00. Since Joomla 4 (because of the mysql 8.0 requirement) that is no longer a valid default value. So it should be set to NULL.
|
||||||
|
|
||||||
|
To do so, you would change your field settings to these:
|
||||||
|
|
||||||
|
Data default = Other\
|
||||||
|
Other Default = EMPTY\
|
||||||
|
Null switch = NULL
|
Loading…
Reference in New Issue
Block a user