Skip to content

Commit

Permalink
CDPT-2259 Don't delete non-existent documents.
Browse files Browse the repository at this point in the history
  • Loading branch information
EarthlingDavey committed Nov 8, 2024
1 parent 9e0f227 commit 4ae0cb3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ DB_HOST=mariadb
DB_USER=wordpress
DB_PASSWORD=wordpress

OPENSEARCH_VERSION=2.12.0
OPENSEARCH_VERSION=2.13.0
OPENSEARCH_URL=http://opensearch:9200

CACHE_HOST=redis
Expand Down
11 changes: 11 additions & 0 deletions bin/composer-post-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -73,3 +73,14 @@ if grep -q $TREE_VIEW_SEARCH $TREE_VIEW_FILE ; then
echo "Fixing warning in cms-tree-page-view..."
sed -i "s/$TREE_VIEW_SEARCH/$TREE_VIEW_REPLACE/g" $TREE_VIEW_FILE
fi


ELASTIC_PRESS_FILE=/var/www/html/public/app/mu-plugins/elasticpress/includes/classes/Indexable/Post/SyncManager.php
ELASTIC_PRESS_SEARCH="\t\$this->action_delete_post( \$post_id );"
ELASTIC_PRESS_REPLACE="\t\$indexable->get( \$post_id ) \&\& \$this->action_delete_post( \$post_id );"

# If search string is in file. Then replace it.
if [ -f "$ELASTIC_PRESS_FILE" ] ; then
echo "Fixing warning in elasticpress. Checking for doc before deleting prevents 404s in logs..."
sed -i "s/$ELASTIC_PRESS_SEARCH/$ELASTIC_PRESS_REPLACE/g" $ELASTIC_PRESS_FILE
fi

0 comments on commit 4ae0cb3

Please sign in to comment.