MantisBT - v3.0 Release
View Issue Details
0001065v3.0 Release[All Projects] Generalpublic2012-02-19 05:182013-08-28 11:19
Reporterrobertbasic 
Assigned Tocaseydk 
PrioritynormalSeveritymajorReproducibilityalways
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version3.0.0 
Summary0001065: Deleting contacts
DescriptionWhen editing a contact, the permission for deleting that contact relies on an uninitialized variable "$msg". Need to figure out what sane default it has to have.
Additional InformationFirst seen here: https://github.com/caseysoftware/web2project/blob/master/modules/contacts/addedit.php#L32

Used: https://github.com/caseysoftware/web2project/blob/master/modules/contacts/addedit.php#L51 and https://github.com/caseysoftware/web2project/blob/master/modules/contacts/addedit.php#L62
TagsNo tags attached.
Attached Files

Notes
(0002406)
robertbasic   
2012-02-19 05:23   
Similary, $this->user_id on this line [1] does not exist.

[1] https://github.com/caseysoftware/web2project/blob/master/modules/contacts/contacts.class.php#L231
(0002493)
Korkonius   
2012-04-21 14:06   
I've done some digging on this to see if it was an easy fix and I can not for the life of me find out where $msg originates...

The closest thing i (my IDE) found was in do_updatecontact.php although i don't feel like it makes any sense. Also the variable is passed on to w2p_Core_BaseObject as a reference. According to method signature and documentation.

In the CContact implementation the signature is:
public function canDelete($msg = '', $oid = null, $joins = null)

Its a bit late here, but doesn't this mean that the value it contains when calling the method doesn't matter since the variable is intended to be used as a return value?

Possibly a related bug that CContact::canDelete does not have the same signature as it's ancestor(?):
public function canDelete(&$msg = '', $oid = null, $joins = null)
(0002537)
caseydk   
2012-05-27 21:00   
Resolved differently than the original pull request, but it works out nicely:
https://github.com/caseysoftware/web2project/pull/99

Issue History
2012-02-19 05:18robertbasicNew Issue
2012-02-19 05:23robertbasicNote Added: 0002406
2012-04-21 14:06KorkoniusNote Added: 0002493
2012-05-27 21:00caseydkNote Added: 0002537
2012-05-27 21:00caseydkStatusnew => resolved
2012-05-27 21:00caseydkResolutionopen => fixed
2012-05-27 21:00caseydkAssigned To => caseydk
2013-08-28 11:14caseydkFixed in Version => 3.0.0
2013-08-28 11:19caseydkStatusresolved => closed