Archive
SugarCRM: check updating of object’s property
Sometimes it’s needed to know about updating of specified object’s property. SugarCRM keeps previous values for all object’s properties in the array fetched_row. For example, to realise it’s new object or just updated we should compare ID from that array and current value of object’s property:
-
if($obj->fetched_row[‘id’] != $obj->id) {
-
echo "This’s a new object!\n";
-
} else {
-
echo "This’s an existing object\n";
-
}
That approach might be used in the handler of logic hook, for example, to perform some action when desire property is changed.
How to change WP password into database
I did it a few times but always made a search and dug WordPress code. So, just generate a new password:
-
PHP -r ‘echo crypt("new_wp_pass") . "\n";’
and update specified user in the table wp_users:
-
UPDATE wp_users SET user_pass=‘generated password hash’ WHERE ID=‘desire user ID’;
Remove subversion stuff from the sources
You may need to remove subversion stuff from some sources to add them onto another repository. Following bash command can do it assuming you’re in the root directory of the sources:
-
for FILE in `find | grep ".svn"`; do if [ -d $FILE ]; then echo "file: $FILE"; rm -rf $FILE; fi; done
IMDB::Film v0.40
A few days ago the new version of Perl module IMDB::Film was released. That module is used to get metadata from the IMDB.com. A few new features was added there:
- information about companies and connections;
- MPAA rating;
- additional information about release such “re-release”, “DVD premiere” etc;
- information about place in the IMDB top.
Also the tests were re-organize a bit. Tests which need to additional connection such release dates, companies and connections moved to the separate section. Test for POD is added and made an optional. Additionally several bugs were fixed.




