<h4>Newsfeed Controller — $return_array Undefined Fix (6 methods)</h4><ul><li><strong>ROOT CAUSE:</strong> Comments, likes, and replies appeared to not work (required page reload) because the controller returned PHP warnings before JSON. The warning <code>Undefined variable $return_array</code> corrupted the JSON response. <code>safeParseJSON</code> returned <code>{}</code>, so <code>data.status == 'success'</code> was false, and the UI update code never ran — even though the data was actually saved to the DB.</li><li><strong>Fixed 6 methods:</strong><ul><li><code>insertCommentToNewsfeedPost</code> (line 1767) — comment on own post</li><li><code>likeTheNewsfeedPost</code> (line 1678) — like own post</li><li><code>likeTheComment</code> (line 1867) — like own comment</li><li><code>insertReplyOnAComment</code> (line 1957) — reply to own comment</li><li><code>likeTheReply</code> (line 2045) — like own reply</li><li><code>insertReplyToReply</code> (line 2133) — reply to own reply</li></ul>All had the same pattern: <code>$return_array</code> only initialized inside <code>if (ACTVACCTID \!== $post['acctid_fk'])</code> (notification not needed for self-actions) but referenced unconditionally in <code>json_encode()</code>. Added <code>$return_array = null;</code> before each conditional block.</li></ul><p><strong>File:</strong> controller/newsfeed/newsfeed.controller.php</p><p><strong>Result:</strong> Comments, likes, and replies now display instantly without page reload. Clean JSON responses for all self-actions.</p>