That occurs when you edit the text of an image page, without uploading the image at the same time.
In
vault/core/controller/ui/edit/page/vw.php, find:
Code:
$edit['minor'] = $input->get('minor');
After it, add:
Code:
if (!empty($edit['add_meta']))
{
foreach ($edit['add_meta'] AS $meta)
{
$pagedm->add_meta($meta);
}
}
In
vault/core/controller/ui/edit/attach/vw.php, find:
Code:
$caller->item['skip_dm'] = 'Attach';
$edit['add_types'][] = 'Attach';
Before it, add:
Code:
$input = vw_Hard_Core::controller('Input');
$input->clean_array_gpc('p', array(
'attachfileid' => 'UINT',
'filehash' => 'NOHTML'
));
$filedataid = $input->get('attachfileid');
$filehash = $input->get('filehash');
$edit['filedataid'] = 0;
$edit['filedatahash'] = '';
$edit['filedatasize'] = 0;
$edit['filedatamime'] = '';
if ($filedataid AND (empty($orig['attachfileid']) OR $orig['attachfileid'] != $filedataid))
{
$file = vw_DB::get()->query()->select(array(
'fields' => array(
'attachfileid',
'filesize',
'extension'
),
'table' => 'vw_attachmentfile',
'where' => vw_DB::get()->query()->eq('filehash', "'" . vw_DB::get()->func()->escape_string($filehash) . "'"),
'order' => array('dateline' => 'DESC'),
'first' => 1
));
if ($file AND $file['attachfileid'] == $filedataid)
{
// set a key that doesn't normally exist so it's unique for this action
$edit['filedataid'] = $filedataid;
$edit['filedatahash'] = $filehash;
$edit['filedatasize'] = $file['filesize'];
$edit['filedatamime'] = $file['extension'];
}
}
if (empty($edit['filedataid']) AND !empty($orig['attachfileid']))
{
$edit['add_meta'][] = 'file_' . $orig['extension'];
}
Find:
Code:
$input = vw_Hard_Core::controller('Input');
$input->clean_array_gpc('p', array(
'attachfileid' => 'UINT',
'filehash' => 'NOHTML'
));
if (array_key_exists('has_pending_file', $orig) AND $orig['has_pending_file'] !== null)
{
$caller->errorlist[] = vw_Hard_Core::view('Phrase')->get('vw_file_moderated');
return;
}
$filedataid = $input->get('attachfileid');
$filehash = $input->get('filehash');
$edit['filedataid'] = 0;
$edit['filedatahash'] = '';
$edit['filedatasize'] = 0;
$edit['filedatamime'] = '';
if ($filedataid AND (empty($orig['attachfileid']) OR $orig['attachfileid'] != $filedataid))
{
$file = vw_DB::get()->query()->select(array(
'fields' => array(
'attachfileid',
'filesize',
'extension'
),
'table' => 'vw_attachmentfile',
'where' => vw_DB::get()->query()->eq('filehash', "'" . vw_DB::get()->func()->escape_string($filehash) . "'"),
'order' => array('dateline' => 'DESC'),
'first' => 1
));
if ($file AND $file['attachfileid'] == $filedataid)
{
// set a key that doesn't normally exist so it's unique for this action
$edit['filedataid'] = $filedataid;
$edit['filedatahash'] = $filehash;
$edit['filedatasize'] = $file['filesize'];
$edit['filedatamime'] = $file['extension'];
}
}
Replace with:
Code:
if (array_key_exists('has_pending_file', $orig) AND $orig['has_pending_file'] !== null)
{
$caller->errorlist[] = vw_Hard_Core::view('Phrase')->get('vw_file_moderated');
return;
}
Afterwards:
1. Edit the text of the image again to fix the image metadata.
2. Use AdminCP > Wiki > Maintenance > Rebuild Counters / Caches > Cache Parsed Content.