- ivnish Kazakhstan
Drupal 7 is EOL. Issue will be closed, but patches are still here
If you use flag with session api → , when the session expire the flag is deleted and all the associated data (fields).
This is a huge problem because you are deleting data. Specially if field are associated with the flag.
We lost thousands of thousands of records without knowing it. Now I will have to go throw all the backup and "merge" them...
The problem is with this hook on flag.module
/**
* Implements hook_session_api_cleanup().
*
* Clear out anonymous user flaggings during Session API cleanup.
*/
function flag_session_api_cleanup($arg = 'run') {
// Session API 1.1 version:
if ($arg == 'run') {
$query = db_select('flagging', 'fc');
$query->leftJoin('session_api', 's', 'fc.sid = s.sid');
$result = $query
->fields('fc', array('sid'))
->condition('fc.sid', 0, '<>')
->isNull('s.sid')
->execute();
foreach ($result as $row) {
db_delete('flagging')
->condition('sid', $row->sid)
->execute();
}
}
// Session API 1.2+ version.
elseif (is_array($arg)) {
$outdated_sids = $arg;
db_delete('flagging')->condition('sid', $outdated_sids, 'IN')->execute();
}
}
Closed: outdated
3.0
Flag core
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.
Drupal 7 is EOL. Issue will be closed, but patches are still here