Fix issues with missing order total modules #28

Merged
merged 2 commits into from Sep 28, 2013

Conversation

Projects
None yet
2 participants
Contributor

scottcwilson commented Sep 25, 2013

Several problems can occur if you update your osCommerce database from a fresh version of the source without your old order total modules. You will only see the order total module in the "Install Module" section. But the trouble is, from there, if you try to edit, it won't work, and if you try to remove it will remove the wrong thing. And you can wind up trying to add the module several times, which will put duplicate keys in your database. This PR adds a fix for the remove problem so the right thing is removed, a workaround for the edit problem so the wrong thing isn't edited, and a fix for the duplicate key issue, by checking > 0 rather than == 1.

Owner

haraldpdl commented Sep 25, 2013

Thanks for the PR. Could you tell me which Order Total module versions have caused a problem?

Contributor

scottcwilson commented Sep 25, 2013

Not a particular version but a contributed order total module. So to dup
this issue:

  • Install a contributed order total module to a prior version of OSC (2.2
    say)
    For example Better Together - http://addons.oscommerce.com/info/7880
  • Then update replace your osC installation with a fresh 2.3.3.3
    installation. You now don't have the Better Together files but you still
    have the database entries.
  • Go to admin->modules->order totals ; you will see the issue I am
    describing.

so it's an "upgrade" type of problem.

www.thatsoftwareguy.com - www.twitter.com/thatsoftwareguy -
www.linkedin.com/in/scottcwilson

On Wed, Sep 25, 2013 at 2:40 PM, Harald Ponce de Leon <
notifications@github.com> wrote:

Thanks for the PR. Could you tell me which Order Total module versions
have caused a problem?


Reply to this email directly or view it on GitHubhttps://github.com/osCommerce/oscommerce2/pull/28#issuecomment-25113376
.

Owner

haraldpdl commented Sep 27, 2013

Could you update your master branch with the latest changes from the main repo, and rebase your missing_order_total branch onto your master branch?

I would like to send you a PR with some changes however it's including previous master commits you have not yet pulled in.

Owner

haraldpdl commented Sep 27, 2013

Here are some steps to help you with that :) (origin is your remote repo on github, and upstream is the remote osCommerce/oscommerce2 repo)

In your working directory:

git checkout master
git fetch upstream
git rebase upstream/master
git push origin master

The above makes you work in your master branch, fetches the latest commits from upstream (osCommerce/oscommerce2), rebases the commits into your master branch (you may need to do a merge instead of rebase if you've made your own commits to the master branch (git merge upstream/master)), and then pushes the changes to your github repo. You may need to force the push with git push -f origin master.

git checkout missing_order_total
git rebase master
git push -f origin missing_order_total

The above updates your missing_order_total branch with the lastest master branch commits and rolls your missing_order_total commits on top. A force push is required here as you are rewriting history which conflicts with what has been pushed to github already.

It is generally safe to rewrite and force push commits in branches as branches are considered to be development branches, whereas it should not be done in the master branch as the (fork) master branch should always be in sync with the upstream master branch.

Contributor

scottcwilson commented Sep 27, 2013

OK all done.

Contributor

scottcwilson commented Sep 27, 2013

Harald, I have merged in your changes. Thank you!

Owner

haraldpdl commented Sep 28, 2013

There are still some extra commits in this PR :( Could you perform the following git commands:

(upstream is the remote name for osCommerce/oscommerce2, and origin is the remote name for scottcwilson/oscommerce2)

git checkout master
git fetch upstream
git reset --hard upstream/master
git push -f origin master

This resets your master branch to the osCommerce/oscommerce2 master branch; any custom commits will be deleted (you haven't made any in the master branch so no work will be deleted).

git checkout missing_order_total
git rebase --onto abf820d^ 74efc97
git rebase master
git push -f origin missing_order_total

This will delete a few extra commits in your missing_order_total branch and re-apply your custom commits cleanly onto the latest version of the master branch. This keeps my commit from the PR you merged in however the "Merge pull request #1" commit will be deleted from the rebase command as it is an empty commit.

This should then clean up the commits in the PR and I can safely merge it to osCommerce/oscommerce2.

scottcwilson and others added some commits Sep 25, 2013

@scottcwilson scottcwilson Fix issues with missing order total modules 090925d
@haraldpdl @scottcwilson haraldpdl If a module has been installed and the module files were deleted, the…
… parameters would still exist in the database. If the module files were copied again to the modules directory, installing the module would introduce duplicate module parameters, so when installing a module, check if it has been installed previously and call its remove() function before installing the module again.
9dcc2c8
Contributor

scottcwilson commented Sep 28, 2013

Done.

www.thatsoftwareguy.com - www.twitter.com/thatsoftwareguy -
www.linkedin.com/in/scottcwilson

On Fri, Sep 27, 2013 at 8:02 PM, Harald Ponce de Leon <
notifications@github.com> wrote:

There are still some extra commits in this PR :( Could you perform the
following git commands:

(upstream is the remote name for osCommerce/oscommerce2, and origin is the
remote name for scottcwilson/oscommerce2)

git checkout master
git fetch upstream
git reset --hard upstream/master
git push -f origin master

This resets your master branch to the osCommerce/oscommerce2 master
branch; any custom commits will be deleted (you haven't made any in the
master branch so no work will be deleted).

git checkout missing_order_total
git rebase --onto abf820dhttps://github.com/osCommerce/oscommerce2/commit/abf820d8a6742daae8f85e3a2b627803d7b3c710^
74efc9774efc97

git rebase master
git push -f origin missing_order_total

This will delete a few extra commits in your missing_order_total branch
and re-apply your custom commits cleanly onto the latest version of the
master branch. This keeps my commit from the PR you merged in however the
"Merge pull request #1 #1"
commit will be deleted from the rebase command as it is an empty commit.

This should then clean up the commits in the PR and I can safely merge it
to osCommerce/oscommerce2.


Reply to this email directly or view it on GitHubhttps://github.com/osCommerce/oscommerce2/pull/28#issuecomment-25285448
.

haraldpdl merged commit ee5f89c into osCommerce:master Sep 28, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment