Forums / Cotonti / Development / How to safe data from custom field in a user profile to the DB?

Macik
#41243 2015-12-16 19:50
#41239 foxhound:

I have added a file into my plugin for the "users.edit.update.first" hook. In it I added the $-post as you described yet still my DB is not updated when I update my profile with the new info.

I'm not shure that it should work in Genoa as Extra field utility not fully functional in that branch.

I have enabled dbug mode, the "FOOTER_DEVMODE" tags were already present in my footer but I do not see any messages in my footer upon profile update. Does it only display errors if there are any or does it always display something (something in the sense of "dev info")?

In common way `FOOTER_DEVMODE` should display full sql queries list with certain SQL code and it's timing. If you don't see it on any page check:
- `define('SED_DEBUG', TRUE);` in config.php
- enable debug mode in Admin panel site settings
- place FOOTER_DEVMODE tag in your footer.tpl
So you can find this dev info on all pages.
But !note: you can miss some SQL queries in case it done before actual redirect. This case is applied in User profile update too.

Another prehistoric way to debug is to add log line to your code to save info to logfile. You can save raw SQL query text than use some SQL client to run this query and seeing results.

But best way to deeper inspect you application — is to install some modern IDE and setup Debugger. Than you can see internals step-by-step.

So, I would like to share any erros with you, but there are none.

I must be overlooking something really simple, but I simply cant figure it out. :(

Added 2 hours later:

Got it!

Great.

I am sure I will have some more questions but at least now that I can store dates I can work on the plugin funtionality itself :)

You are welcome.

https://github.com/macik
правильный хостинг — https://goo.gl/fjCa1F