Skip to content

Upstream apply#1

Merged
Vitexus merged 30 commits intoVitexus:masterfrom
CE-PhoenixCart:master
Apr 7, 2021
Merged

Upstream apply#1
Vitexus merged 30 commits intoVitexus:masterfrom
CE-PhoenixCart:master

Conversation

@Vitexus
Copy link
Copy Markdown
Owner

@Vitexus Vitexus commented Apr 7, 2021

IMPORTANT: Please do not create a PR unless you have first created an ISSUE and your issue has been discussed and accepted.

Any change needs to be discussed BEFORE you make a Pull Request. Failure to do so WILL result in immediate rejection of your Pull Request.

Please provide enough information in your raised ISSUE so that others can understand and review the details of your Test Plan:

Explain the details for making this change. What existing problem does the pull request solve?
Example: When "Adding a function to do X", explain why it is necessary to have a way to do X.

Test plan (required)

Demonstrate the code is solid.

Example: Link to an install that shows your new code in action. If that is not possible provide screenshots and/or the exact commands you ran and their output, screenshots / videos if the pull request changes UI.

gburton and others added 30 commits March 11, 2021 17:43
When an order is loaded from the database after returning from an
off-site payment processor, it needs the country ID to load the
country information.  This adds the country ID to each address in
the order table.

Addresses bugs where country information is missing after returning
from a payment processor.
Historically the database has been accessed through functions in the
database.php files.  This modifies those two files to use the new
Database class internally.  This should allow add-ons to continue to
work for now.  Also it means that we can modify core over time.

The Database class will be available but people can migrate to using
it directly at their own speed.  After core stops using each function,
we can formally deprecate it.  Then after the next .0 version, we can
remove those functions.

Also migrates one admin function to the Database class.
These are the new HTML classes to replace the functionality in the
includes/functions/html_output.php files.  Most of these relate to
form inputs, as that is primarily what the html_output.php files
provide.  Also replaces the catalog href_link.php and image.php
files.

Unifies the catalog and admin functionality.
This adds the capability to pass input into a set of hooks such that
the results of each is passed to the next in the "chain".  This is
needed for the Href class.

Also removes the concept of aliases.  Now hooks are called by action
regardless of group.  This simplifies the handling of pipeline and
siteWide hooks.

The generate method is modified immediately to no longer take a
group argument.

The call method has been deprecated in favor of a cat method that
does not take a group argument.  For compatibility reasons, call
simply calls cat at the moment.  When all the call references are
replaced in core, it will get a deprecation trigger.

Refactors registration and loading to accomodate the removal of the
group argument.

Adds a new `set` method to allow code to register individual hooks.
Previously pipeline hooks used the concept of aliases, registering
the pipeline group as the page group instead.  The hooks class was
modified to no longer do this.  This alters the things that call
generate to no longer pass the group argument.

This causes a conflict between the checkout pipeline and the system
hooks in application_top.php.  That conflict is resolved by renaming
the checkout pipeline's action to differentiate it from the system
hooks.
Adds database hooks for the Href chain hook.

Renames the checkout pipeline's action to startCheckout so as not to
call the system startApplication.
The new HTML classes for links and images need to give different
results in admin and catalog.  This is a helper class to manage
the prefixes in admin.  In catalog, the default values are used.
As part of the migration to classes for HTML output, this maps the
old html_output functions to the class equivalents.  This should
allow us to migrate to calling the classes directly gradually while
enabling us to start immediately.
Update the cart-specific names to match the name of the current cart.
Note the old name.  Utilized namespacing.

Removed exceptions hack as no longer necessary under the new naming
scheme.

Also updates the modified files to current coding standards.
Minor code clean up, e.g. to eliminate unnecessary whitespace.

Migrated from tep_get_version to new Versions class.

Added condition for when the version feed server fails to answer or
when the XML load is broken.
If the page is submitted and the same menu is shown again, we will
usually want to display the value from the first submission.

This changes the class to default to doing that but still allows for
developers to override this (by clearing the selection or explicitly
setting it to something else).  Also allows to easily set a default
value that will be overridden by the submitted value if it exists.

Adjusts the compatibility functions to reflect these changes.
New standard hook names:  $hooks for shop hooks, $admin_hooks for
admin hooks, and $all_hooks for both.

Use $hooks to access hooks for the shop site specifically;
$admin_hooks for the admin site; or $all_hooks if the hook may be
called from either site (as happens in catalog classes like Href
and order).

Also some general modernization, e.g. the use of the new $db global
and access session variables from $_SESSION.  Copied the system
hooks code from catalog as preparation for modularizing the admin
file in the future.
Primarily switching from database and html_output functions to the
new class methods.

These files were selected because they had already been modified
for some other reason and would be included in the release.  Other
files will be done over time.
The mysqli object has an insert_id property not method.  But use the
procedural version instead, as the alternating string/int properties
don't always work.
The object-oriented way is to use a property, but mixed type
properties do not always work as expected.  Switching to the more
reliable procedural function.
@Vitexus Vitexus merged commit 1ccbd14 into Vitexus:master Apr 7, 2021
Vitexus pushed a commit that referenced this pull request May 31, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants