Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add notifications about comments actions #2212

Closed
romanlesnikov opened this issue Jul 11, 2019 · 1 comment
Closed

Add notifications about comments actions #2212

romanlesnikov opened this issue Jul 11, 2019 · 1 comment
Assignees
Milestone

Comments

@romanlesnikov
Copy link
Collaborator

Add notifications about comments actions (vote, voteUp/Down, etc)
m.623340

@romanlesnikov romanlesnikov added this to the 10.0.0-B3 milestone Jul 11, 2019
@romanlesnikov romanlesnikov assigned AlexTr and AntonLV and unassigned AlexTr Jul 11, 2019
AntonLV added a commit that referenced this issue Jul 12, 2019
@AntonLV
Copy link
Contributor

AntonLV commented Jul 12, 2019

Field author_id was added in sys_cmts_ids system table. The following code can be used during update to the next version to transfer Author IDs for already collected comments.

$oDb = BxDolDb::getInstance();
$aSystems = $oDb->getPairs("SELECT `ID`, `Table` FROM `sys_objects_cmts` WHERE 1", "ID", "Table");

$iUpdated = 0;
$aComments = $oDb->getAll("SELECT * FROM `sys_cmts_ids` WHERE `author_id`='0'");
foreach($aComments as $aComment) {
    if(!isset($aSystems[$aComment['system_id']]))
        continue;

    $iUpdated += $oDb->query("UPDATE `sys_cmts_ids` SET `author_id`=:author_id WHERE `id`=:id LIMIT 1", array(
        'id' => (int)$aComment['id'],
        'author_id' => (int)$oDb->getOne("SELECT `cmt_author_id` FROM `" . $aSystems[$aComment['system_id']] . "` WHERE `cmt_id`=:cmt_id", array(
            'cmt_id' => (int)$aComment['cmt_id']
        ))
    )) !== false ? 1 : 0;
}

@AntonLV AntonLV added the watch label Jul 12, 2019
AntonLV added a commit that referenced this issue Jul 15, 2019
@AlexTr AlexTr closed this as completed Aug 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants