From 1650faacfc3c89edf2807c1cc101a2df6e4e30f6 Mon Sep 17 00:00:00 2001 From: EarthlingDavey <15802017+EarthlingDavey@users.noreply.github.com> Date: Mon, 18 Nov 2024 12:19:33 +0000 Subject: [PATCH] Update composer-post-install.sh --- bin/composer-post-install.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/bin/composer-post-install.sh b/bin/composer-post-install.sh index 58a55ccb7..e31f0cf79 100755 --- a/bin/composer-post-install.sh +++ b/bin/composer-post-install.sh @@ -84,10 +84,6 @@ fi ELASTIC_PRESS_TARGET_PACKAGE="wpackagist-plugin/elasticpress" ELASTIC_PRESS_TARGET_VERSION="5.1.3" ELASTIC_PRESS_INSTALLED_VERSION=$(get_installed_version $ELASTIC_PRESS_TARGET_PACKAGE) -# Variables for the find and replace. -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 the target version is not inatalled then exit. if [ "$ELASTIC_PRESS_INSTALLED_VERSION" != "$ELASTIC_PRESS_TARGET_VERSION" ] ; then @@ -95,6 +91,11 @@ if [ "$ELASTIC_PRESS_INSTALLED_VERSION" != "$ELASTIC_PRESS_TARGET_VERSION" ] ; t exit 1; fi +# Variables for the find and replace. +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 [ -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