Coder Social home page Coder Social logo

Comments (5)

florent-blanvillain avatar florent-blanvillain commented on August 20, 2024

https://github.com/noamt/elasticsearch-gorm-plugin/blob/master/src/groovy/org/grails/plugins/elasticsearch/AuditEventListener.groovy#L126

or

https://github.com/noamt/elasticsearch-gorm-plugin/blob/master/src/groovy/org/grails/plugins/elasticsearch/AuditEventListener.groovy#L133

from elasticsearch-grails-plugin.

noamt avatar noamt commented on August 20, 2024

I must say I haven't tested the plugin with Grails 2.3.x
There was another complaint in regard to the version, but I hadn't had a chance to deal with it yet.

from elasticsearch-grails-plugin.

dalelotts avatar dalelotts commented on August 20, 2024

I'm getting the same error in Grails 2.2.4. event.entityAccess is always null.

from elasticsearch-grails-plugin.

otho avatar otho commented on August 20, 2024

There are two contructors in AbstractPersistenceEvent. One with EntityAccess and one without. The second one sets entity and entityAccess to null and populates entityObject instead. That one is obviously used. So in AuditEventListener you have to change the lines in the respective events from

void onPostInsert(PostInsertEvent event) {
====> OLD def entity = event.entityAccess.entity
if (elasticSearchContextHolder.isRootClass(entity.class)) {
pushToIndex(entity)
}
}

to

void onPostInsert(PostInsertEvent event) {
====> NEW def entity = event.entityAccess?.entity ?: event.entityObject
if (elasticSearchContextHolder.isRootClass(entity.class)) {
pushToIndex(entity)
}
}

from elasticsearch-grails-plugin.

noamt avatar noamt commented on August 20, 2024

I've pushed a fix.
Thanks everyone, your help is much appreciated!

from elasticsearch-grails-plugin.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.