Jump to content


A strage bug with callback

bug callback bug

  • Please log in to reply
1 reply to this topic

#1 Amit Shah

Amit Shah

    grocery CRUD Master

  • Advanced Member
  • PipPipPip
  • 1,192 posts
  • LocationMumbai, India

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 :)



#2 web-johnny

web-johnny

    grocery CRUD Author

  • Administrators
  • 1,096 posts
  • LocationLondon

Posted 25 January 2015 - 08: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 :)


Posted Image





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users