Ignore Content

Ignore Content [Paid] 3.2.3

No permission to buy ($30.00)
When using with XF2.0.x, this add-on does N+1 queries for each thread in a forum's thread list as the 'with' clauses is not extended in XF2.0
 
Does this effect the ‘What’s new’ threads too? For example if you choose to ignore ‘Forum 1’ does that ignore all threads from ‘Forum 1’ in ‘What’s new’?

Thanks,

Alex
 
@truonglv

You probably should wrap the contents of Truonglv\IgnoreContent\Service\Ignore->ignore() in a try { ... } catch (DuplicateKeyException $e) {} block to prevent silly duplicate ignore exceptions.

Code:
XF\Db\DuplicateKeyException: MySQL query error [1062]: Duplicate entry '38267-3101-thread' for key 'user_id_content_id_content_type'
src/XF/Db/AbstractStatement.php:212
Generated by: xxxx
Apr 29, 2019 at 12:46 PM

INSERT  INTO `xf_ignore_content` (`content_type`, `content_id`, `user_id`, `id`, `ignore_date`) VALUES (?, ?, ?, ?, ?)
------------

#0 src/XF/Db/Mysqli/Statement.php(196): XF\Db\AbstractStatement->getException('MySQL query err...', 1062, '23000')
#1 src/XF/Db/Mysqli/Statement.php(77): XF\Db\Mysqli\Statement->getException('MySQL query err...', 1062, '23000')
#2 src/XF/Db/AbstractAdapter.php(79): XF\Db\Mysqli\Statement->execute()
#3 src/XF/Db/AbstractAdapter.php(160): XF\Db\AbstractAdapter->query('INSERT  INTO `x...', Array)
#4 src/XF/Mvc/Entity/Entity.php(1403): XF\Db\AbstractAdapter->insert('xf_ignore_conte...', Array, false)
#5 src/XF/Mvc/Entity/Entity.php(1135): XF\Mvc\Entity\Entity->_saveToSource()
#6 src/addons/Truonglv/IgnoreContent/Service/Ignore.php(57): XF\Mvc\Entity\Entity->save()
#7 src/addons/Truonglv/IgnoreContent/XF/Pub/Controller/Misc.php(125): Truonglv\IgnoreContent\Service\Ignore->ignore()
#8 src/XF/Mvc/Dispatcher.php(249): Truonglv\IgnoreContent\XF\Pub\Controller\Misc->actionIgnoreContent(Object(XF\Mvc\ParameterBag))
#9 src/XF/Mvc/Dispatcher.php(88): XF\Mvc\Dispatcher->dispatchClass('XF:Misc', 'IgnoreContent', 'json', Object(XF\Mvc\ParameterBag), '', Object(Resetera\ImageOptions\XF\Pub\Controller\Misc), NULL)
#10 src/XF/Mvc/Dispatcher.php(41): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch))
#11 src/XF/App.php(1931): XF\Mvc\Dispatcher->run()
#12 src/XF.php(329): XF\App->run()
#13 index.php(13): XF::runApp('XF\\Pub\\App')
#14 {main}
 
@truonglv

You probably should wrap the contents of Truonglv\IgnoreContent\Service\Ignore->ignore() in a try { ... } catch (DuplicateKeyException $e) {} block to prevent silly duplicate ignore exceptions.

Code:
XF\Db\DuplicateKeyException: MySQL query error [1062]: Duplicate entry '38267-3101-thread' for key 'user_id_content_id_content_type'
src/XF/Db/AbstractStatement.php:212
Generated by: xxxx
Apr 29, 2019 at 12:46 PM

INSERT  INTO `xf_ignore_content` (`content_type`, `content_id`, `user_id`, `id`, `ignore_date`) VALUES (?, ?, ?, ?, ?)
------------

#0 src/XF/Db/Mysqli/Statement.php(196): XF\Db\AbstractStatement->getException('MySQL query err...', 1062, '23000')
#1 src/XF/Db/Mysqli/Statement.php(77): XF\Db\Mysqli\Statement->getException('MySQL query err...', 1062, '23000')
#2 src/XF/Db/AbstractAdapter.php(79): XF\Db\Mysqli\Statement->execute()
#3 src/XF/Db/AbstractAdapter.php(160): XF\Db\AbstractAdapter->query('INSERT  INTO `x...', Array)
#4 src/XF/Mvc/Entity/Entity.php(1403): XF\Db\AbstractAdapter->insert('xf_ignore_conte...', Array, false)
#5 src/XF/Mvc/Entity/Entity.php(1135): XF\Mvc\Entity\Entity->_saveToSource()
#6 src/addons/Truonglv/IgnoreContent/Service/Ignore.php(57): XF\Mvc\Entity\Entity->save()
#7 src/addons/Truonglv/IgnoreContent/XF/Pub/Controller/Misc.php(125): Truonglv\IgnoreContent\Service\Ignore->ignore()
#8 src/XF/Mvc/Dispatcher.php(249): Truonglv\IgnoreContent\XF\Pub\Controller\Misc->actionIgnoreContent(Object(XF\Mvc\ParameterBag))
#9 src/XF/Mvc/Dispatcher.php(88): XF\Mvc\Dispatcher->dispatchClass('XF:Misc', 'IgnoreContent', 'json', Object(XF\Mvc\ParameterBag), '', Object(Resetera\ImageOptions\XF\Pub\Controller\Misc), NULL)
#10 src/XF/Mvc/Dispatcher.php(41): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch))
#11 src/XF/App.php(1931): XF\Mvc\Dispatcher->run()
#12 src/XF.php(329): XF\App->run()
#13 index.php(13): XF::runApp('XF\\Pub\\App')
#14 {main}
That quite strange. I have check it call function. Look like it’s has new case or cache issue. I will looking into soon.
 
That quite strange. I have check it call function. Look like it’s has new case or cache issue. I will looking into soon.
It is a database race condition (selects generally don't take out locks, so checking before hand just reduces the deadlocks), the only real solution is to accept one request and let the other rollback without causing errors.
 
For incompatible with Modern Statistics. It's much issue from that add-on they must do same behavior with threads list (in forum view). In this case very simple to ask the author that remove any ignore threads from visitor.

With "Unread count" I guess that author still increase counter with ignored threads cause performance issue.
It would be great, if you make your own Unread Post Count add-on, with full support of Ignore Content.
 
We've purchased this add-on and would like to import user ignore preferences from the previous [Nobita] Ignore Threads 1.1.1 add-on we used in XF1.5

There are two tables - xf_node_ignore [user_id + node_id] and xf_ignore_thread [thread_id + user_id + ignore_time]

Can we simply move these into the new xf_ignore_content table and give them a content_type of "thread" and "node"?
 
We've purchased this add-on and would like to import user ignore preferences from the previous [Nobita] Ignore Threads 1.1.1 add-on we used in XF1.5

There are two tables - xf_node_ignore [user_id + node_id] and xf_ignore_thread [thread_id + user_id + ignore_time]

Can we simply move these into the new xf_ignore_content table and give them a content_type of "thread" and "node"?
To import you may run this query:
Code:
insert ignore into xf_ignore_content
(content_id, content_type, user_id, ignore_date)
select thread_id, 'thread', user_id, ignore_time
from xf_ignore_thread
 
Just to add - the query I've tested to import the ignored forums is:
Code:
insert ignore into xf_ignore_content
(content_id, content_type, user_id, ignore_date)
select node_id, 'tl_ignore_forum', user_id, '1557875306'
from xf_node_ignore
 
Top Bottom