-
-
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
Feature Request: Allow saving #62
Comments
What version are you using? preventSaving got removed in the latest major version. |
I have contao 4.4 and dc_multilingual 4. The preventSaving is still in the master:
Don‘t let it irritate you. $this->preventSaving(false); leads to prevent the model from save. |
We struggle with this problem on Contao 4.9 with Version 4, too :-( |
Gibt es hier schon Neuigkeiten? Ich habe mir aktuell so in einer abstrakten Klasse beholfen (könnte man bei Mehrfachverwendung auch in einen Trait packen): public function saveIfOriginal(): bool
{
if (0 !== (int)$this->langPid) {
return false;
}
$registry = Registry::getInstance();
if ($this->id && !$registry->isRegistered($this)) {
$registry->register($this);
}
$this->blnPreventSaving = false;
$this->save();
return true;
} |
Hello,
we integrated DC_Multilingual in many projects now. It works just fine. Only one thing is quite a problem: the disallowing of saving (preventSaving) as described here.
I understand the problem (the record is merged from multiple records (the translations)).
Now I thought how we could solve this issue and one option would be to introduce a new method called
saveUntranslatedRecord()
. This method would work on the data retrieved from the database without taking into account the ranslations. InsaveUntranslatedRecord()
we would store the modified values merged with the untranslated values (retrieved from the database ignoring the translations) using anUPDATE
.I could also imagine that we wouldn't have to introduce a new
saveUntranslatedRecord()
but put this code intosave()
. Of course this would be BC breaking, but at the moment callingsave()
throws an error only.What do you think? I could also write a pull request if you agree that this would be a way to deal with the limitation of not being able to
save()
.Thanks in advance.
Bye Defcon0
The text was updated successfully, but these errors were encountered: