Skip to content

Commit

Permalink
Merge branch 'main' into topic-remove-persistent
Browse files Browse the repository at this point in the history
  • Loading branch information
fballiano authored Oct 14, 2024
2 parents 4c44348 + 7301407 commit ef28dd2
Show file tree
Hide file tree
Showing 18 changed files with 87 additions and 113 deletions.
79 changes: 79 additions & 0 deletions .github/workflows/sync-om.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
name: Sync daily OM commits to Maho

on:
schedule:
- cron: '0 6 * * *' # Run at 6 AM UTC every day
workflow_dispatch:

jobs:
sync-om:
runs-on: ubuntu-latest
steps:
- name: Checkout Maho
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Configure Git
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
- name: Fetch OM updates and create PRs
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
# Fetch OpenMage repository
git remote add upstream https://github.com/OpenMage/magento-lts.git
git fetch upstream
# Get yesterday's date
yesterday=$(date -d "yesterday" +%Y-%m-%d)
# Get list of commits from yesterday
commits=$(git log --since="$yesterday 00:00:00" --until="$yesterday 23:59:59" --format="%H" upstream/main)
# Function to create a PR for a commit
create_pr_for_commit() {
commit_hash=$1
branch_name="sync-openmage-${commit_hash:0:8}"
# Create a new branch
git checkout -b "$branch_name"
# Cherry-pick the commit
if git cherry-pick "$commit_hash"; then
# Push the branch
git push -u origin "$branch_name"
# Get commit message
commit_msg=$(git log -1 --pretty=format:"%s" "$commit_hash")
# Check if the commit is from a PR
pr_number=$(git log -1 --pretty=format:"%b" "$commit_hash" | grep -oP "(?<=Pull Request #)\d+")
if [ -n "$pr_number" ]; then
pr_title="OM PR $pr_number"
else
pr_title="OM commit: $commit_hash"
fi
# Create PR
gh pr create --title "$pr_title" --body "This PR syncs the OpenMage commit: $commit_hash
Original commit message: $commit_msg
For more details, see: https://github.com/OpenMage/magento-lts/commit/$commit_hash"
else
echo "Failed to cherry-pick commit $commit_hash. Skipping."
git cherry-pick --abort
fi
# Return to main branch
git checkout main
}
# Process each commit
for commit in $commits; do
create_pr_for_commit "$commit"
done
1 change: 0 additions & 1 deletion app/code/core/Mage/Adminhtml/Helper/Help/Mapping.php
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,6 @@ abstract class Mage_Adminhtml_Helper_Help_Mapping extends Mage_Core_Helper_Abstr
'system_config/edit/section/cataloginventory' => 'configuration/catalog/inventory.html',
'system_config/edit/section/sitemap' => 'configuration/catalog/google-sitemap.html',
'system_config/edit/section/rss' => 'configuration/catalog/rss-feeds.html',
'system_config/edit/section/sendfriend' => 'configuration/catalog/email-to-a-friend.html',
'system_config/edit/section/newsletter' => 'configuration/customers/newsletter.html',
'system_config/edit/section/customer' => 'configuration/customers/customer-configuration.html',
'system_config/edit/section/wishlist' => 'configuration/customers/wishlist.html',
Expand Down
4 changes: 0 additions & 4 deletions app/code/core/Mage/Adminhtml/etc/adminhtml.xml
Original file line number Diff line number Diff line change
Expand Up @@ -194,10 +194,6 @@
<title>Currency Setup</title>
<sort_order>120</sort_order>
</currency>
<sendfriend translate="title">
<title>Email to a Friend</title>
<sort_order>140</sort_order>
</sendfriend>
<admin translate="title">
<title>Admin</title>
<sort_order>100</sort_order>
Expand Down
11 changes: 0 additions & 11 deletions app/code/core/Mage/Catalog/Block/Product/View.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,17 +91,6 @@ public function getProduct()
return Mage::registry('product');
}

/**
* Check if product can be emailed to friend
*
* @return bool
*/
public function canEmailToFriend()
{
$sendToFriendModel = Mage::registry('send_to_friend_model');
return $sendToFriendModel && $sendToFriendModel->canEmailToFriend();
}

/**
* Retrieve url for direct adding product to cart
*
Expand Down
16 changes: 0 additions & 16 deletions app/code/core/Mage/Catalog/Helper/Product.php
Original file line number Diff line number Diff line change
Expand Up @@ -149,22 +149,6 @@ public function getThumbnailUrl($product)
return $url;
}

/**
* @param Mage_Catalog_Model_Product $product
* @return string
*/
public function getEmailToFriendUrl($product)
{
$categoryId = null;
if ($category = Mage::registry('current_category')) {
$categoryId = $category->getId();
}
return $this->_getUrl('sendfriend/product/send', [
'id' => $product->getId(),
'cat_id' => $categoryId
]);
}

/**
* @return array
*/
Expand Down
2 changes: 0 additions & 2 deletions app/code/core/Mage/Catalog/Model/Session.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@
* @method int getLastVisitedCategoryId()
* @method string getLimitPage()
* @method bool getParamsMemorizeDisabled()
* @method array getSendfriendFormData()
* @method $this setSendfriendFormData(array $value)
* @method string getSortDirection()
* @method string getSortOrder()
* @method $this unsDisplayMode()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
'sales_email/creditmemo_comment/template' => 'sales_email_creditmemo_comment_template',
'sales_email/shipment/template' => 'sales_email_shipment_template',
'sales_email/shipment_comment/template' => 'sales_email_shipment_comment_template',
'sendfriend/email/template' => 'sendfriend_email_template',
'sitemap/generate/error_email_template' => 'sitemap_generate_error_email_template',
'wishlist/email/email_template' => 'wishlist_email_email_template',
];
Expand Down
17 changes: 0 additions & 17 deletions app/code/core/Mage/Reports/Model/Event/Observer.php
Original file line number Diff line number Diff line change
Expand Up @@ -130,23 +130,6 @@ public function catalogProductView(Varien_Event_Observer $observer)
return $this->_event(Mage_Reports_Model_Event::EVENT_PRODUCT_VIEW, $productId);
}

/**
* Send Product link to friends action
*
* @return $this
*/
public function sendfriendProduct(Varien_Event_Observer $observer)
{
if (!$this->_enabledReports) {
return $this;
}

return $this->_event(
Mage_Reports_Model_Event::EVENT_PRODUCT_SEND,
$observer->getEvent()->getProduct()->getId()
);
}

/**
* Remove Product from Compare Products action
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,6 @@
'event_type_id' => Mage_Reports_Model_Event::EVENT_PRODUCT_VIEW,
'event_name' => 'catalog_product_view'
],
[
'event_type_id' => Mage_Reports_Model_Event::EVENT_PRODUCT_SEND,
'event_name' => 'sendfriend_product'
],
[
'event_type_id' => Mage_Reports_Model_Event::EVENT_PRODUCT_COMPARE,
'event_name' => 'catalog_product_compare_add_product'
Expand Down
8 changes: 0 additions & 8 deletions app/code/core/Mage/Reports/etc/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -128,14 +128,6 @@
</reports>
</observers>
</catalog_controller_product_view>
<sendfriend_product>
<observers>
<reports>
<class>reports/event_observer</class>
<method>sendfriendProduct</method>
</reports>
</observers>
</sendfriend_product>
<catalog_product_compare_add_product>
<observers>
<reports>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
INSERT INTO {$this->getTable('report_event_types')} VALUES
(1, 'catalog_product_view'),
(2, 'sendfriend_product'),
(3, 'catalog_product_compare_add_product'),
(4, 'checkout_cart_add_product'),
(5, 'wishlist_add_product'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
INSERT INTO {$this->getTable('report_event_types')} VALUES
(1, 'catalog_product_view'),
(2, 'sendfriend_product'),
(3, 'catalog_product_compare_add_product'),
(4, 'checkout_cart_add_product'),
(5, 'wishlist_add_product'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,6 @@
<h1><?= $_helper->productAttribute($_product, $_product->getName(), 'name') ?></h1>
</div>

<?php if ($this->canEmailToFriend()): ?>
<p class="email-friend"><a href="<?= $this->helper('catalog/product')->getEmailToFriendUrl($_product) ?>"><?= $this->__('Email to a Friend') ?></a></p>
<?php endif ?>

<?= $this->getReviewsSummaryHtml($_product, false, true) ?>
<?= $this->getChildHtml('alert_urls') ?>
<?= $this->getChildHtml('product_type_data') ?>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,6 @@
<?php $_wishlistSubmitUrl = $this->helper('wishlist')->getAddUrlWithCustomParams($_product, [], false); ?>

<ul class="sharing-links">
<?php if ($this->canEmailToFriend()): ?>
<li><a href="<?= $this->helper('catalog/product')->getEmailToFriendUrl($_product) ?>" class="link-email-friend" title="<?= Mage::helper('core')->quoteEscape($this->__('Email to a Friend')) ?>"><?= $this->__('Email to a Friend') ?></a></li>
<?php endif ?>

<?php $_helper = $this->helper('catalog/output'); ?>
<?php $_productName = urlencode(trim($_helper->productAttribute($_product, $_product->getName(), 'name')))?>
<?php $_productImageUrl = urlencode(trim((string)$this->helper('catalog/image')->init($_product, 'image')))?>
Expand Down
30 changes: 0 additions & 30 deletions app/locale/en_US/template/email/product_share.html

This file was deleted.

14 changes: 7 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,13 @@
"extra": {
"patches": {
"shardj/zf1-future": {
"MAG-1.1.1": "https://raw.githubusercontent.com/OpenMage/composer-patches/74862e7a9fa29dd62c5c02d585d931ce9e3c5815/patches/MAG-1.1.1.patch",
"MAG-1.9.3.0": "https://raw.githubusercontent.com/OpenMage/composer-patches/74862e7a9fa29dd62c5c02d585d931ce9e3c5815/patches/MAG-1.9.3.0.patch",
"MAG-1.9.3.7 - SUPEE-10415": "https://raw.githubusercontent.com/OpenMage/composer-patches/74862e7a9fa29dd62c5c02d585d931ce9e3c5815/patches/MAG-1.9.3.7.patch",
"OM-918 - Add runtime cache to Zend_Locale_Data": "https://raw.githubusercontent.com/OpenMage/composer-patches/74862e7a9fa29dd62c5c02d585d931ce9e3c5815/patches/OM-918.patch",
"OM-1081 - Not detecting HTTPS behind a proxy": "https://raw.githubusercontent.com/OpenMage/composer-patches/74862e7a9fa29dd62c5c02d585d931ce9e3c5815/patches/OM-1081.patch",
"OM-2047 - Pass delimiter char to preg_quote": "https://raw.githubusercontent.com/OpenMage/composer-patches/74862e7a9fa29dd62c5c02d585d931ce9e3c5815/patches/OM-2047.patch",
"OM-2050 - Prevent checking known date codes": "https://raw.githubusercontent.com/OpenMage/composer-patches/74862e7a9fa29dd62c5c02d585d931ce9e3c5815/patches/OM-2050.patch"
"MAG-1.1.1": "https://raw.githubusercontent.com/MahoCommerce/maho-composer-patches/e75f155864138ef4ee2b18a82797d6f40d71ad51/MAG-1.1.1.patch",
"MAG-1.9.3.0": "https://raw.githubusercontent.com/MahoCommerce/maho-composer-patches/e75f155864138ef4ee2b18a82797d6f40d71ad51/MAG-1.9.3.0.patch",
"MAG-1.9.3.7 - SUPEE-10415": "https://raw.githubusercontent.com/MahoCommerce/maho-composer-patches/e75f155864138ef4ee2b18a82797d6f40d71ad51/MAG-1.9.3.7.patch",
"OM-918 - Add runtime cache to Zend_Locale_Data": "https://raw.githubusercontent.com/MahoCommerce/maho-composer-patches/e75f155864138ef4ee2b18a82797d6f40d71ad51/OM-918.patch",
"OM-1081 - Not detecting HTTPS behind a proxy": "https://raw.githubusercontent.com/MahoCommerce/maho-composer-patches/e75f155864138ef4ee2b18a82797d6f40d71ad51/OM-1081.patch",
"OM-2047 - Pass delimiter char to preg_quote": "https://raw.githubusercontent.com/MahoCommerce/maho-composer-patches/e75f155864138ef4ee2b18a82797d6f40d71ad51/OM-2047.patch",
"OM-2050 - Prevent checking known date codes": "https://raw.githubusercontent.com/MahoCommerce/maho-composer-patches/e75f155864138ef4ee2b18a82797d6f40d71ad51/OM-2050.patch"
},
"colinmollenhour/magento-redis-session": {
"Cm_RedisSession-Revert-190": "https://raw.githubusercontent.com/MahoCommerce/maho-composer-patches/0424e4b13657d2745931b9063020b005428b9334/Cm_RedisSession-Revert-190.patch"
Expand Down
2 changes: 1 addition & 1 deletion composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion lib/MahoCLI/Commands/LegacyRenameMysql4Classes.php
Original file line number Diff line number Diff line change
Expand Up @@ -544,7 +544,6 @@ protected function execute(InputInterface $input, OutputInterface $output): int
'<rule_mysql4>' => '<rule_resource>',
'<sales_mysql4>' => '<sales_resource>',
'<salesrule_mysql4>' => '<salesrule_resource>',
'<sendfriend_mysql4>' => '<sendfriend_resource>',
'<shipping_mysql4>' => '<shipping_resource>',
'<sitemap_mysql4>' => '<sitemap_resource>',
'<tag_mysql4>' => '<tag_resource>',
Expand Down

0 comments on commit ef28dd2

Please sign in to comment.