summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xliberty_plugins/mime.flatdefault.php12
1 files changed, 12 insertions, 0 deletions
diff --git a/liberty_plugins/mime.flatdefault.php b/liberty_plugins/mime.flatdefault.php
index 431a495..dad3feb 100755
--- a/liberty_plugins/mime.flatdefault.php
+++ b/liberty_plugins/mime.flatdefault.php
@@ -175,6 +175,12 @@ if( !function_exists( '\Bitweaver\Liberty\mime_default_update' )) {
$gBitSystem->mDb->query( $sql, [ $pStoreRow['upload']['name'], $pStoreRow['upload']['type'], $pStoreRow['upload']['size'], $pStoreRow['user_id'], $pStoreRow['file_id'] ] );
}
+ // store pdf text layer in main content
+ if ( !empty( $pStoreRow['data'] ) ) {
+ $sql = "UPDATE `".BIT_DB_PREFIX."liberty_content` SET `data` = ? WHERE `content_id` = ?";
+ $gBitSystem->mDb->query( $sql, [ $pStoreRow['data'], $pStoreRow['content_id'] ] );
+ }
+
// ensure we have the correct guid in the db
if( empty( $pStoreRow['attachment_plugin_guid'] )) {
$pStoreRow['attachment_plugin_guid'] = LIBERTY_DEFAULT_MIME_HANDLER;
@@ -226,6 +232,12 @@ if( !function_exists( '\Bitweaver\Liberty\mime_default_store' )) {
];
$gBitSystem->mDb->associateInsert( BIT_DB_PREFIX."liberty_attachments", $storeHash );
+ // add text layer from attachment pdf and the like
+ if ( !empty( $pStoreRow['data'] ) ) {
+ $sql = "UPDATE `".BIT_DB_PREFIX."liberty_content` SET `data` = ? WHERE `content_id` = ?";
+ $gBitSystem->mDb->query( $sql, [ $pStoreRow['data'], $pStoreRow['content_id'] ] );
+ }
+
$ret = true;
} else {
$pStoreRow['errors']['liberty_process'] = "There was a problem processing the file.";