При каждом пересохранении ноды материал заново отправляется в VK дублируясь в записях.

Каждый раз ставить/убирать галочку отправки не могу, так как она для пользователей кто создает материалы недоступна.
Можно ли добавить вариант работы модуля, который позволял бы не создавать пост в VK, если он уже был когда-то создан?

Comments

kala4ek’s picture

Assigned: Unassigned » kala4ek
kala4ek’s picture

Version: 7.x-2.0 » 7.x-2.x-dev
Assigned: kala4ek » Unassigned
Status: Active » Needs review

Created a patch. Now status sending status stored with node info and if node already was posted to VK, checkbox "post it" disabled by default.

kala4ek’s picture

StatusFileSize
new2.9 KB

Forget to attach patch :)

anpolimus’s picture

StatusFileSize
new3.24 KB

Hi.
Thanks for your patch. I have reviewed it and it is working properly and is fixing this issue.
There were some issues:
1.

'#default_value' => !$form['#node']->vkxp_sent && variable_get('vkxp_node_enabled_default_' . $form['#node']->type),    

were producing warning. I've changed ! to empty().

2. Hook_uninstall produced fatal error. It was not connected with your code, but I've fixed that for making your patch stable.

anpolimus’s picture

Only one thing that is seems to be strange (bad UX).
I think, we need to have a separate checkbox, called "Deactivate vk_post checkbox when node has already posted to Vk.com"

anpolimus’s picture

StatusFileSize
new5.19 KB

I have implemented additional code to your patch with admin interface changes.

Now, at CT admin page, you could add checkbox for preventing double-checking.

  • Anatoliy Polyakov committed 966fb8a on 7.x-2.x
    git commit -m 'Issue #2444579 by anpolimus, kala4ek: Дублирование...
anpolimus’s picture

Status: Needs review » Patch (to be ported)
anpolimus’s picture

Patch has been commited. This pathc would be added to future stable release.

anpolimus’s picture

Status: Patch (to be ported) » Fixed

Task marked as fixed. This commit would be at 7.x-2.21 version.

anpolimus’s picture

Status: Fixed » Closed (fixed)