⚠ In case you've missed it, we have migrated to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This is an archived forum. ⚠

  •     

profile picture

A strage bug with callback



Amit Shah
  • profile picture
  • Member

Posted 24 January 2015 - 07:34 AM

this was a very strange bug discovered - i know it aint the fault of grocerycrud but something to do at the core level .. where if the name of the column is "name" itself - the callback completely fails ... but if the same is renamed to "rname" - it works perfectly fine. This was absolutely bizard siatuation where i tried to debug all instance of possibility but then discovered the reason lies at the core php level..

So here is a suggestion - do not use name as mean of callback. Rather - just user it something like first_name / full_name .. etc for the same.

 

Sorry - my fault - wrong bug registered but what was discovered as the real cause was nothing to do with the name as the field.. rather the real reason was .. there was some relation field that too had name and hence the fieldname here that was being processed was the

<tablename>.<fieldname>

here was all the confusion... while registering the callback - it was just refered as "name" but was automatically turned out to be "retailers.name" .. so do not blame like a callback is not being called up for - but rather just try to echo out all the fields that are being processed in the change_list function in grocerycrud library.

There u will be able to see some of the fields (if they colide with callbacks) being transformed from just field name to tablename + fieldname ...

 

Happy GCing :)


web-johnny
  • profile picture
  • Administrator
  • 1,166 posts

Posted 25 January 2015 - 20:37 PM

Thanks Amit for sharing this with us. Just one more thing for anyone that want to somehow debug his callback here is the way that I suggest: http://stackoverflow.com/questions/8201343/debugging-in-grocery-crud

 

Happy GCing to everyone :)