-
-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sync Driver with DC_Table + CS #79
base: main
Are you sure you want to change the base?
Conversation
Thanks for the tedious work! I intentionally keep the "legacy" code style in my DCs (this one and in Isotope) to make it easier to compare it to Contaos DC_Table. If we now use new code style that would be very hard, wouldn't it? |
Yes, you're right I reverted my CS commit and fixed the indentations manually - because the core uses tabs! By the way I'm not sure if all changes are really compatible with 4.4! |
I have removed usage of the global Contao classes in 3dd8dd6, unfortunately that means this PR needs to be rebased 😕 |
I've rebased 🚀 By the way I compared with |
@@ -354,7 +366,7 @@ public function edit($intId=null, $ajaxId=null) | |||
$this->objActiveRecord->{$this->strField} = $this->varValue; | |||
|
|||
// Build the row and pass the current palette string (thanks to Tristan Lins) | |||
$blnAjax ? $strAjax .= $this->row($this->strPalette) : $return .= $this->row($this->strPalette); | |||
$blnAjax ? $arrAjax[$thisId] .= $this->row($this->strPalette) : $return .= $this->row($this->strPalette); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We often got the following warning in the logs in one of our projects: Warning: Only the first byte will be assigned to the string offset
It's probably because of the uninitialized index $thisId
, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm, it is initialized in the core here: https://github.com/contao/contao/blob/4.13/core-bundle/src/Resources/contao/drivers/DC_Table.php#L1941
I've compared and "synced" the core
DC_Table
to theDriver
, so that we can better see the changes in the future.The Contao Classes are now used with the
Contao
namespace.Some deprecations were replaced and some CS was applied.
Even some PHP 8 warnings could be solved.
In the
edit
method I was not sure about the following points.So I left them as they were in the
Driver
:VERSION_NUMBER
+subpal
Autofocus the first field
Input::get('nc')
Input::get('popup')
split-button
$strVersionField
$strBackUrl
Set the focus if there is an error
<script>
Show a warning if the record has been saved by another user
saveNduplicate