Anonymous Login
2019-02-21 11:41 PST

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0001065v3.0 Release[All Projects] Generalpublic2013-08-28 11:19
Reporterrobertbasic 
Assigned Tocaseydk 
PrioritynormalSeveritymajorReproducibilityalways
StatusclosedResolutionfixed 
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

-Relationships
+Relationships

-Notes

~0002406

robertbasic (developer)

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 (reporter)

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 (administrator)

Resolved differently than the original pull request, but it works out nicely:
https://github.com/caseysoftware/web2project/pull/99
+Notes

-Issue History
Date Modified Username Field Change
2012-02-19 05:18 robertbasic New Issue
2012-02-19 05:23 robertbasic Note Added: 0002406
2012-04-21 14:06 Korkonius Note Added: 0002493
2012-05-27 21:00 caseydk Note Added: 0002537
2012-05-27 21:00 caseydk Status new => resolved
2012-05-27 21:00 caseydk Resolution open => fixed
2012-05-27 21:00 caseydk Assigned To => caseydk
2013-08-28 11:14 caseydk Fixed in Version => 3.0.0
2013-08-28 11:19 caseydk Status resolved => closed
+Issue History