Commit Graph

137 Commits

Author SHA1 Message Date
vedanshujain 6ed8ffe850 Addressed PR review comments #27734 2020-11-10 14:23:45 +05:30
vedanshujain eeb8851717 Minor fixups for PR #27734 2020-11-10 14:23:44 +05:30
vedanshujain bb1e2f44ae Removed/reverted more unnecessary changes. 2020-11-10 14:23:43 +05:30
vedanshujain a5fb3178f0 Drop CacheHydration class and do it directly.
Primary reason for dropping the cache hydration is that seems like we can acheive the same results without it, so no need to add this additional complexity to our code.
2020-11-10 14:23:43 +05:30
vedanshujain f5d0275786 Refactor methods to break down into smaller units for re-usability.
This commit breaks down `read_meta_data` so that individual methods for cache key and setting raw meta data can be reused.

Also adds set_meta_data_from_raw_data to initialize metadata from manual cache.
2020-11-10 14:23:39 +05:30
Claudio Sanches d48f1d4e2e Fixed package tag usage 2020-08-05 13:36:24 -03:00
Peter Fabian 1f9cd9eae9
Merge pull request #24066 from malviyaritesh/fix/24062
Filter meta value even if key not found
2020-01-23 14:59:39 +01:00
rmalviya b5447cd060 Filter meta value even if key not found
Resolves #24062.
2019-07-03 22:25:51 +05:30
Mike Jolley a0d4f6174c Consistent CRUD classes with before/after save hooks 2019-04-17 12:47:35 +01:00
Mike Jolley 77eba86818 Get rid of reflection method to speed up set_props 2019-01-30 16:21:06 +00:00
Mike Jolley 9a8d11e9f6 phpcs 2019-01-30 16:20:49 +00:00
Mike Jolley 7eda1bb412 Only use WP Error when needed 2019-01-30 16:20:41 +00:00
Jamsheer 95f639ad92
Update abstract-wc-data.php 2018-11-02 20:43:58 +05:30
jamsheerkrd bb5df05920
Update abstract-wc-data.php
https://github.com/woocommerce/woocommerce/issues/21640
2018-10-24 14:05:49 +05:30
Khan M Rashedun-Naby 25ab294d40 Unnecessay Spaces Removed 2018-07-19 10:33:22 +06:00
Bharat Kambariya fdeadcdbea fix param doc for update_meta and add_meta fn. 2018-06-21 11:47:18 +05:30
Mike Jolley 52a7fafd74 Search for matching keys when updating meta data 2018-06-11 12:50:49 +01:00
Gerhard Potgieter 42978bb031 PHPCS passing for abstract-wc-data.php 2018-03-05 13:29:18 +02:00
Mike Jolley 05e7eaae03 get_meta_data return array values
Closes #17997
2017-12-05 13:14:12 +00:00
The Dramatist 1783953f15 Admin metaboxes views translation escaping fix (#17776)
* Data escaped and validated. Plus translator comment documentation added.

* If it should be int then we should change the empty string default parameter to 0 as in 'if' condition checking 0 and empty string are same.

* Extra bracket removed.

* Indentation is fixed now.

* The taxonomy object should not be assigned to a variable before checking if this is a taxonomy or not.

* echo esc_attr__ replaced by esc_attr_e and visually tested.

* As I use WordPress VIP Coding Standard, they were marking them as warnings. But now it's fixed again.

* Escaping fix

* Extra Bracket Fix Again
2017-11-21 17:50:30 +00:00
Mike Jolley e72a297842 Break up logic so is callable is only checked on internal meta keys 2017-10-27 16:23:05 +01:00
Cesar Rodas 32da25c4f1 Improved "is_internal_meta_key"
Improved is_internal_meta_key to check if the meta_key has a setter or a getter before returning TRUE and calling doing_it_wrong
2017-10-23 22:22:31 -03:00
Mike Jolley 39443d23e5 Fix meta data clone for products 2017-10-16 21:05:29 -07:00
Mike Jolley 240a321dd0 Revert get_meta_data changes and return array of WC_Meta_Data objects 2017-10-04 14:12:43 +01:00
Mike Jolley 7460189752 Handle WC_Meta_Data in get_data() and API
Fixes #17003
2017-10-02 13:12:33 +01:00
Brent Shepherd 81b9160973 Add offending key to error message 2017-09-15 15:58:34 -07:00
Brent Shepherd f404affff4 Tweak internal meta notice
To remove ambiguity with accessing properties via $object->meta_key
syntax, which was deprecated with WC 3.0.
2017-09-15 15:48:53 -07:00
Mike Jolley 3778918a0a Merge branch 'master' into pr/14751
# Conflicts:
#	includes/class-wc-structured-data.php
2017-08-08 15:28:31 +01:00
Mike Jolley f47bb39a06 Merge pull request #15479 from woocommerce/add/poc-no-managing-meta-directly
Proof of concept to error when internal meta props are accessed directly
2017-07-27 15:54:24 +01:00
Jaydeep Rami 46d3638089 Fix missing return statement (#16148)
* Fix missing return statement

* Fix missing return statement

* Fix missing return statement

* Fix missing return statement

* Fix missing return statement

* Fix missing return statement
2017-07-20 18:01:14 +01:00
Jaydeep Rami 3522857d23 Fix typo in WooCommerce plugin (#16135)
* Fixed typo

* Fixed more typo

* Fixed more typo

* Fix tyop

* Fix more typo

* Fix more typo

* Fix typo

* Fix typo

* Fix typo

* Fix typo datatime object

* Fix short name of compat

* Fix typo: update short name

* Fix typo "deactive" to "deactivate" and short BW - Compat

* Fix typo "Backwards compat"

* Fix typo 'parameters'

* Fix more typo 'pararmeters'

* Fix typo 'compund'

* FIx typo order

* Fix typo

* Fix typo 'incorrecly'

* Fix typo 'genarate'

* Fix typo 'reletive'

* Fix typo 'Handly'

* Fix typo 'rotatated'

* Fix typo

* Fix typo 'additonal'

* Fix typos
2017-07-17 11:10:52 +01:00
Boro Sitnikovski 68d512ae01 Address PR comments 2017-06-08 13:00:28 +02:00
Boro Sitnikovski 0271a9e2fe Update version 2017-06-07 16:20:09 +02:00
Boro Sitnikovski 00847da730 Fix 2017-06-07 12:33:05 +02:00
Boro Sitnikovski 1584836fa9 Code style fixes 2017-06-07 12:31:42 +02:00
Boro Sitnikovski b5fd62274f Map the correct function and use notice instead of exception 2017-06-07 12:30:03 +02:00
Boro Sitnikovski efd42e6bc4 Proof of concept to error when internal meta props are accessed directly 2017-06-06 19:13:53 +02:00
Cesar Rodas 5997ffd4b1 Fixed coding styles issues 2017-06-01 11:46:05 -04:00
David de Boer d788b15073 Set delete_meta_data @param to accept a string
Set delete_meta_data @param to accept a string
2017-06-01 01:47:52 +02:00
Mike Jolley 2366a036e3 Add id cache group to invalidate by ID 2017-05-30 14:37:29 +01:00
Cesar Rodas b158ba2c47 Merge remote-tracking branch 'origin/master' into improve_meta_data_updates 2017-05-23 17:34:12 -04:00
Rasmus Bengtsson 185934fad9 Fix phpdoc to include params and correct types 2017-05-15 13:50:52 +02:00
Claudio Sanches 84dfaf3c09 Merge pull request #14851 from franticpsyx/clone-meta-data
[3.0] Clone each meta stdClass object when cloning a WC_Data object
2017-05-03 18:03:54 -03:00
Manos Psychogyiopoulos 8f7671f066 Clone each meta object when cloning WC_Data object to avoid modifying original meta stdClass objects 2017-05-03 16:37:01 +03:00
Cesar Rodas 7a8011e878 Merge remote-tracking branch 'origin/master' into improve_meta_data_updates 2017-04-27 12:29:09 -04:00
Cesar Rodas 2e6dc17bd5 Improved update_meta_data function
Also updated unit tests that was expecting the meta data as stdclass objects
2017-04-27 09:28:19 -04:00
Cesar Rodas 91de312eb2 Make sure the meta data cache is not shared among instances
See #14620 for more context. In there I thought this was the desired behaviour and I enhanced it. After talking with @mikejolley he explained to me that it was not by designed.

This commit makes sure the meta data cache is not shared among instances
2017-04-26 13:51:52 -04:00
Cesar Rodas 6eb7dcabf2 Added WC_Meta_Data object
It wraps an array, and tells if there were any changes before saving it
2017-04-26 10:18:41 -04:00
Brent Shepherd 0e40d2c764 Don't return deleted meta
By using $this->get_meta_data() which passed meta through the
WC_Data::filter_null_meta() method, rather than $this->meta_data
which still has null values set.
2017-04-14 13:58:00 -07:00
Mike Jolley 76d962b606 since 2017-04-10 21:52:06 +01:00