Comments (7)
All entries are also stored twice?
from revisions-plugin.
All entries are also stored twice?
Both listen to the same events, therefore it will be stored twice.
revisions-plugin/traits/Revisions.php
Lines 15 to 35 in da90583
Revisionable:
public function initializeRevisionable()
{
if (!is_array($this->revisionable)) {
throw new Exception(sprintf(
'The $revisionable property in %s must be an array to use the Revisionable trait.',
get_class($this)
));
}
$this->bindEvent('model.afterUpdate', function () {
$this->revisionableAfterUpdate();
});
$this->bindEvent('model.afterDelete', function () {
$this->revisionableAfterDelete();
});
}
from revisions-plugin.
@TimFoerster Hey, you need to only include trait from this plugin, if you add both traits it will fire 2 times.
from revisions-plugin.
This is already the case
use Samuell\Revisions\Traits\Revisions;
class Company extends Model
{
use Revisions;
protected $revisionable = [
'section',
'name',
'address',
'type',
'station_id',
'content',
'contacts',
'divisions',
'persons'
];
...
Error appears only with ocms 3.
from revisions-plugin.
@TimFoerster if you remove that bindEvent it works correctly?
from revisions-plugin.
I have the same problem.
You need to comment this part on your plugin inside revisions/traits/Revisions.php
/* $model->bindEvent('model.afterUpdate', function () use ($model) {
$model->revisionableAfterUpdate();
});
$model->bindEvent('model.afterDelete', function () use ($model) {
$model->revisionableAfterDelete();
});*/
from revisions-plugin.
Related Issues (12)
- Deleting a grouped revision only deletes a single revision HOT 8
- Method locale does not exist. HOT 3
- Displaying a changed checkboxlist, radio and displaying richeditor without tags HOT 2
- SQL error due to ->groupBy in getHistory() method HOT 3
- Date always detected as a change in the revision HOT 1
- Checkbox in popup are not visibles HOT 1
- Alter the output before rendering HOT 1
- Many to many relations HOT 1
- Issue with rendering of changed RichTextEditor field HOT 2
- Repeaters and Dropdowns throwing errors in revisionhistory field type HOT 3
- Add localization strings
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from revisions-plugin.