An update would be really appreciated drewm rachelandrew
Posts by Jason
-
-
I have also noticed this problem / error on the Shop Dashboard, see attached, when upgrading a clients PHP version.
The only difference between no warning and warning was the PHP version 7.1 vs 7.3. I have fixed the issue and tested / all seems to be working.
On addons>perch_shop>modes>shop.post.php I changed count($data['items']) on lines 208 & 209 to PerchUtil::count($data['items'])
This fixes the issue. The reason I believe is after PHP 7.2 the count function changed in behaviour. See here: https://stackoverflow.com/ques…57945/php-7-2-count-errorShould this be in the next release of Perch Shop? drewm previous comment here tells me it should?
Quote"Ah, good call. Most count() calls go through PerchUtil::count(), which should protect against this. That was a rare one which didn't.'"
-
Due to things changing and me needing to split my time differently, I'm not sure what the roadmap is. There's a bunch of work done on v4, and I need to figure out whether I scale back on the initial 4.0 and ship it, try and roll those features into a 3.x and ship it, or wait until I've got more of 4.0 done.
There's been some talk of compat issues with PHP 7.4, so I'd want to track those down and see what can be patched.
drewm with my business hat on I would say ship an initial V4.0 sooner rather than later, this will breath (with all respect, because I really respect what you have made over the last 10 years) life into the product / create excitement. If it's paired with the new subscription model it may help the revenue which could allow you to have extra resources to develop new releases quicker, updates, documentation etc. Just my 2 cents but it is what I would do.
I would also say Perch Shop should be a paid add-on. At the moment we can literally build a shop on a £60 Perch License. Compared to something similar like Craft I would say Perch is currently undervalued / too cheap.
-
Hi Hussain, yes I do & yes that's solved it. You're a star.
I'll guess I'll have to change my flow?
-
Thanks hus_hmd , yes it's got me stumped...
Here is the debug code from the registration page after the form has been submitted.
Code- Debug Message - Perch 3.1.5
- [1] SELECT * FROM perch3_pages WHERE pagePath='/register.php' LIMIT 1
- [1] SELECT * FROM perch3_shop_cart WHERE cartID=46
- [1] SELECT * FROM perch3_shop_cart WHERE cartID=46
- [30] SELECT DISTINCT settingID, settingValue FROM perch3_settings WHERE userID=0
- [0] SELECT COUNT(*) FROM perch3_members WHERE memberPassword IS NOT NULL AND memberEmail='email@email.com'
- [0] SELECT COUNT(*) FROM perch3_members WHERE memberPassword IS NOT NULL AND memberEmail='email@email.com'
- [1] SELECT * FROM perch3_members_forms WHERE formKey='register' LIMIT 1
- INSERT INTO perch3_members(memberAuthType,memberEmail,memberPassword,memberStatus,memberCreated,memberProperties) VALUES('native','email@email.com','$P$BGtDCqPrSEh/bZ70t.luwtBBw6rHBA0','pending','2020-02-19 14:22:45','{\"first_name\":\"Name\",\"last_name\":\"Surnam\"}')
- [1] SELECT * FROM perch3_members WHERE memberID='19' LIMIT 1
- No ids to log.
- Using email template: /srv/users/strident/apps/strident-motability/public/strident/addons/apps/perch_members/templates/members/emails/new_member_notification.html (html)
- Building message with Perch template
- [1] Using template: /addons/apps/perch_members/templates/members/emails/new_member_notification.html
- Sent email: "A new member is waiting approval" to jasonfuller@me.com
- UPDATE perch3_members SET memberAuthID='19' WHERE memberID='19'
- No ids to log.
- Using template: /templates/pages/attributes/default.html
- Using sub-template: /templates/pages/attributes/seo.html
- [250] SELECT country, countryID FROM perch3_shop_countries WHERE countryActive=1 ORDER BY country ASC
- Using template: /templates/shop/checkout/customer_create.html
- [3] SELECT regionKey, regionHTML FROM perch3_content_regions WHERE regionPage='/register.php' OR regionPage='*' ORDER BY regionPage DESC
-
Sorry, still no luck! Still doesn't pull through to the CMS
Code- Array
- (
- [first_name] => Jason
- [last_name] => Surname
- [email] => hello18@emailaddress.com
- [telephone_number] => 5678
- [company_name] => CoName
- [password] => hello18
- [password2] => hello18
- [company] => test1
- [address_1] => test2
- [address_2] => test3
- [postcode] => test4
- [city] => test5
- [county] => test6
- [country] => 236
- [shipping_first_name] => Jason
- [shipping_last_name] => Surname
- [shipping_company] => testCo
- [shipping_address_1] => Address Line 1
- [shipping_address_2] => Address Line 2
- [shipping_city] => Town Name
- [shipping_county] => Norfolk
- [shipping_postcode] => KSIO322
- [shipping_country] => 236
- [cms-form] => cmVnaXN0ZXI6cGVyY2hfc2hvcDovdGVtcGxhdGVzL3Nob3AvY2hlY2tvdXQvY3VzdG9tZXJfY3JlYXRlLmh0bWw6MTU4MjExODg5MA==
- )
This is the debug on the User's Account Page Details
Code- Debug Message - Perch 3.1.5
- [1] SELECT * FROM perch3_members_sessions WHERE sessionID='0cb654960be23b775cf8e8665408a03ff26f7e45' AND sessionHttpFootprint='7c33a638afece83b813674b173793a4185573291' AND sessionExpires>'2020-02-19 13:29:24' LIMIT 1
- User is logged in
- [1] SELECT * FROM perch3_pages WHERE pagePath='/account/index.php' LIMIT 1
- [1] SELECT * FROM perch3_shop_cart WHERE cartID=46
- [1] SELECT * FROM perch3_shop_cart WHERE cartID=46
- Using template: /templates/pages/attributes/default.html
- Using sub-template: /templates/pages/attributes/seo.html
- [1] SELECT * FROM perch3_shop_customers WHERE memberID=18
- [1] SELECT * FROM perch3_shop_customers WHERE memberID='18' AND customerDeleted IS NULL LIMIT 1
- [1] SELECT * FROM perch3_shop_customers WHERE customerEmail='hello18@emailaddress.com' AND customerDeleted IS NULL LIMIT 1
- INSERT INTO perch3_shop_customers(customerDynamicFields,memberID,customerCreated) VALUES('{\"first_name\":\"Jason\",\"last_name\":\"Surname\",\"email\":\"hello18@emailaddress.com\"}','18','2020-02-19 13:29:24')
- [1] SELECT * FROM perch3_shop_customers WHERE customerID='15' LIMIT 1
- No ids to log.
- UPDATE perch3_shop_customers SET customerDynamicFields='{\"first_name\":\"Jason\",\"last_name\":\"Surname\",\"email\":\"hello18@emailaddress.com\"}', memberID='18', customerCreated='2020-02-19 13:29:24', customerFirstName='Jason', customerLastName='Surname', customerEmail='hello18@emailaddress.com', customerUpdated='2020-02-19 13:29:24' WHERE customerID='15'
- No ids to log.
- [9] SELECT statusKey FROM perch3_shop_order_statuses WHERE statusDeleted IS NULL ORDER BY statusIndex ASC
- [nil] SELECT main.* FROM perch3_shop_orders main WHERE 1=1 AND customerID='15' AND orderStatus IN ('paid', 'processing', 'cancelled', 'dispatched', 'returned', 'partial_refund', 'refunded') ORDER BY orderCreated ASC
- [30] SELECT DISTINCT settingID, settingValue FROM perch3_settings WHERE userID=0
- Using template: /templates/shop/orders/list.html
- [1] SELECT * FROM perch3_shop_customers WHERE memberID=18
- [nil] SELECT main.* FROM perch3_shop_addresses main WHERE 1=1 AND (customerID=15) AND addressDeleted IS NULL AND orderID IS NULL ORDER BY addressTitle ASC
- Using template: /templates/shop/addresses/shipping.html
- [250] SELECT country, countryID FROM perch3_shop_countries WHERE countryActive=1 ORDER BY country ASC
- [1] SELECT * FROM perch3_shop_customers WHERE memberID=18
- [1] SELECT * FROM perch3_shop_addresses WHERE customerID='15' AND orderID IS NULL AND countryID>0 AND addressSlug='default'
- no address
- [1] SELECT * FROM perch3_shop_addresses WHERE customerID='15' AND orderID IS NULL AND countryID>0 AND addressSlug='default'
- INSERT INTO perch3_shop_addresses(addressDynamicFields,addressTitle,addressSlug,addressCreated) VALUES('{\"first_name\":\"Jason\",\"last_name\":\"Surname\",\"address_1\":false,\"address_2\":false,\"postcode\":false,\"country\":false,\"company\":false,\"city\":false,\"customer\":\"15\",\"phone\":false,\"county\":false,\"instructions\":false}','default','default','2020-02-19 13:29:24')
- [1] SELECT * FROM perch3_shop_addresses WHERE addressID='177' LIMIT 1
- No ids to log.
- UPDATE perch3_shop_addresses SET addressDynamicFields='{\"first_name\":\"Jason\",\"last_name\":\"Surname\",\"address_1\":false,\"address_2\":false,\"postcode\":false,\"country\":false,\"company\":false,\"city\":false,\"customer\":\"15\",\"phone\":false,\"county\":false,\"instructions\":false}', addressTitle='default', addressSlug='default', addressCreated='2020-02-19 13:29:24', addressFirstName='Jason', addressLastName='Surname', addressCompany='', addressLine1='', customerID='15', countryID='', addressUpdated='2020-02-19 13:29:24' WHERE addressID='177'
- Invalid query: SQLSTATE[HY000]: General error: 1366 Incorrect integer value: '' for column 'countryID' at row 1
- No ids to log.
- [1] SELECT * FROM perch3_shop_countries WHERE countryID='' LIMIT 1
- No country set for address (name)
- [1] SELECT * FROM perch3_shop_addresses WHERE customerID='15' AND orderID IS NULL AND countryID>0 AND addressSlug='shipping'
- no address
- [1] SELECT * FROM perch3_shop_addresses WHERE customerID='15' AND orderID IS NULL AND countryID>0 AND addressSlug='default'
- INSERT INTO perch3_shop_addresses(addressDynamicFields,addressTitle,addressSlug,addressCreated) VALUES('{\"first_name\":\"Jason\",\"last_name\":\"Surname\",\"address_1\":false,\"address_2\":false,\"postcode\":false,\"country\":false,\"company\":false,\"city\":false,\"customer\":\"15\",\"phone\":false,\"county\":false,\"instructions\":false}','shipping','shipping','2020-02-19 13:29:24')
- [1] SELECT * FROM perch3_shop_addresses WHERE addressID='178' LIMIT 1
- No ids to log.
- UPDATE perch3_shop_addresses SET addressDynamicFields='{\"first_name\":\"Jason\",\"last_name\":\"Surname\",\"address_1\":false,\"address_2\":false,\"postcode\":false,\"country\":false,\"company\":false,\"city\":false,\"customer\":\"15\",\"phone\":false,\"county\":false,\"instructions\":false}', addressTitle='shipping', addressSlug='shipping', addressCreated='2020-02-19 13:29:24', addressFirstName='Jason', addressLastName='Surname', addressCompany='', addressLine1='', customerID='15', countryID='', addressUpdated='2020-02-19 13:29:24' WHERE addressID='178'
- Invalid query: SQLSTATE[HY000]: General error: 1366 Incorrect integer value: '' for column 'countryID' at row 1
- No ids to log.
- [1] SELECT * FROM perch3_shop_countries WHERE countryID='' LIMIT 1
- No country set for address (name)
- Using template: /templates/shop/customers/customer_details.html
- [3] SELECT regionKey, regionHTML FROM perch3_content_regions WHERE regionPage='/account/index.php' OR regionPage='*' ORDER BY regionPage DESC
This is the page
PHP- <?php
- include('../perch/runtime.php');
- perch_layout('header',[
- "strict" => true,
- ]); ?>
- <section id="account">
- <?php perch_shop_orders() ?>
- <div class="details">
- <div class="full">
- <h1>Your Information</h1>
- </div>
- <div class="full">
- <div class="col">
- <h2 class="blue" id="shipping">Shipping Address</h2>
- <?php perch_shop_customer_addresses([
- 'template' => 'addresses/shipping.html',
- ]); ?>
- </div>
- <div class="col" id="details">
- <h2 class="blue">Your Details</h2>
- <?php perch_shop_customer_edit_form([
- 'template' => 'customers/customer_details.html',
- ]); ?>
- </div>
- <div class="col">
- <h2 class="blue">Password</h2>
- <p>•••••••••••</p>
- <a class="button" href="/account/update-password">Change Password</a>
- </div>
- </div>
- </div>
- <div class="full">
- <div class="proceed">
- <a href="/account/logout" class="button">Log Out</a>
- </div>
- </div>
- </section>
- <?php perch_layout('footer');
- ?>,
-
Yes, this is what I get:
Code- Array
- (
- [first_name] => Jason
- [last_name] => Surname
- [email] => hello17@emailaddress.com
- [telephone_number] => 1234567890
- [company_name] => CompanyCo
- [password] => hello17
- [password2] => hello17
- [company] =>
- [address_1] =>
- [address_2] =>
- [postcode] =>
- [city] =>
- [county] =>
- [country] => 236
- [shipping_first_name] => Jason
- [shipping_last_name] => Surname
- [shipping_company] => CompanyCo
- [shipping_address_1] => Address Street 1
- [shipping_address_2] => Address Street 1
- [shipping_city] => Townsvile
- [shipping_county] => Norfolk
- [shipping_postcode] => GH7822h
- [shipping_country] => 236
- [cms-form] => cmVnaXN0ZXI6cGVyY2hfc2hvcDovdGVtcGxhdGVzL3Nob3AvY2hlY2tvdXQvY3VzdG9tZXJfY3JlYXRlLmh0bWw6MTU4MjExNzcwMQ==
-
Code
- <perch:form id="register" method="post" app="perch_shop">
- <h3 class="white">Your Details</h3>
- <perch:label for="first_name">First name</perch:label>
- <perch:input type="text" id="first_name" required="true" label="First name" />
- <perch:error for="first_name" type="required"><p class="error">Please add your name</p></perch:error>
- <perch:label for="last_name">Last name</perch:label>
- <perch:input type="text" id="last_name" required="true" label="Last name" />
- <perch:error for="last_name" type="required"><p class="error">Please add your name</p></perch:error>
- <perch:label for="email">Email</perch:label>
- <perch:input type="email" id="email" required="true" placeholder="you@company.com" helper="PerchMembers_Members::check_email" />
- <perch:error for="email" type="required"><p class="error">Please add your email address</p></perch:error>
- <perch:error for="email" type="helper"><p class="error">That email address is already in use</p></perch:error>
- <perch:label for="telephone_number">Telephone Number</perch:label>
- <perch:input type="text" id="telephone_number" required="true" label="Telephone Number" />
- <perch:error for="telephone_number" type="required"><p class="error">Please add your contact number</p></perch:error>
- <perch:label for="company_name">Company Name</perch:label>
- <perch:input type="text" id="company_name" required="true" label="Company Name" />
- <perch:error for="company_name" type="required"><p class="error">Please add your Company Name</p></perch:error>
- <perch:label for="password">Create a password</perch:label>
- <perch:input type="password" id="password" required="true" match-with="password2" />
- <perch:error for="password" type="required"><p class="error">Please add a password</p></perch:error>
- <perch:error for="password" type="match"><p class="error"></p>Passwords do not match</p></perch:error>
- <perch:label for="password2">Type your password again</perch:label>
- <perch:input type="password" id="password2" required="true" />
- <perch:error for="password2" type="required"><p class="error">Please repeat your password</p></perch:error>
- <perch:input type="hidden" id="company" label="Company"/>
- <perch:input type="hidden" id="address_1" label="Address 1" />
- <perch:input type="hidden" id="address_2" label="Address 2" />
- <perch:input type="hidden" id="postcode" label="Postal code" />
- <perch:input type="hidden" id="city" label="City" />
- <perch:input type="hidden" id="county" label="County" />
- <perch:input type="hidden" value="236" id="country" label="Country" />
- <h3 class="white">Shipping Information</h3>
- <p>Please enter the name & address you would like your orders sent to. You can also edit this later.</p>
- <perch:label for="shipping_first_name">First name</perch:label>
- <perch:input type="text" id="shipping_first_name" required label="First name" />
- <perch:label for="shipping_last_name">Last name</perch:label>
- <perch:input type="text" id="shipping_last_name" required label="Last name" />
- <perch:label for="shipping_company">Company</perch:label>
- <perch:input type="text" id="shipping_company" label="Company" />
- <perch:label for="shipping_address_1">Address 1</perch:label>
- <perch:input type="text" id="shipping_address_1" required label="Address 1" />
- <perch:label for="shipping_address_2">Address 2</perch:label>
- <perch:input type="text" id="shipping_address_2" label="Address 2" />
- <perch:label for="shipping_city">Town / City</perch:label>
- <perch:input type="text" id="shipping_city" label="Town / City" />
- <perch:label for="shipping_county">State or County</perch:label>
- <perch:input type="text" id="shipping_county" label="County" />
- <perch:label for="shipping_postcode">Postal code</perch:label>
- <perch:input type="text" id="shipping_postcode" label="Postal code" required />
- <perch:label for="shipping_country">Country</perch:label>
- <perch:input type="select" options="<perch:shop id="country_list" />" value="236" id="shipping_country" label="Country" />
- <perch:input type="submit" value="Register" class="button white" />
- <perch:success>
- <h3 class="white">Thank You for Registering!</h3>
- </perch:success>
- </perch:form>
I've also tried the customer_create.html default template too and hit the same issues
-
Hi, Has anybody had an issue where perch shop doesn't register the initial billing & shipping addressees? I am getting this on the Debug when trying to view them.
Invalid query: SQLSTATE[HY000]: General error: 1366 Incorrect integer value: '' for column 'countryID' at row 1
I have a country field set on the registration form, and I still get the error even when trying the default customer_create.html template. Even weirder this was working the other day and I haven't touched (I Think!) the registration process. The database on perch3_shop_addresses is also now showing a lack of this field whereas before it was filling. Can anybody help me? Thanks!
-
I also tried to fire up a demo the other day and nothing happened.
-
Hi,
I am building a shop which uses Cart Properties however when the server is using PHP 7.2 or higher it gives this PHP warning when using perch_shop_cart()
Warning: count(): Parameter must be an array or an object that implements Countable in XXXXXXXX/addons/apps/perch_shop/lib/PerchShop_Cart.class.php on line 516
After reading this threads here I changed line 516 in /addons/apps/perch_shop/lib/PerchShop_Cart.class.php from
if (count($json)) { to if (PerchUtil::count($json)) {
This clears the PHP warning, 2 questions, is this okay and should this be in a future update?
-
Thanks Drew, Appreciated
-
Commercially we are exploring new options like Kirby CMS as we are struggling to sell Perch to larger clients due to a lack of roadmap / regular updates / bug fixes.
From a business point of view we need more reassurance. We have a few projects to complete in Perch but it I think we will have to transition away, which is a shame because it's always been a great CMS & we've used it for years. Can Perch HQ provide any reassurance?
For example https://perchrunway.com has been down since the start of the week, how can we refer clients to see what CMS we will be using when it flags a SSL error?
Perch shop has this issue outstanding with no updates: SCA Regulation
We really do love perch, there is no other CMS like it and want to continue using it but unfortunately clients do have a say in what we do as they pay the bills.
-
Thanks Hussein,
Whilst my previous solution was working, I think I prefer keeping it all within postSlug. Here's my final solution for future reference if anyone needs to composite blog urls from other fields.
HTML- <perch:blog id="postSector" type="select" label="Sector" options="Aviation|aviation, Rail|rail, Commercial|commercial, Industrial|industrial, Food Industry|food-industry, Highways|highways, Domestic|domestic" allowempty="false" required suppress>
- <perch:blog id="postSlugPre" type="slug" for="postTitle" label="URL Slug" suppress editable help="Delete & save to generate new slug from post title">
- <perch:blog id="postSlug" type="composite" for="postSector postSlugPre" join="/" suppress>
-
Just been trying to get custom blog url / slugs working under the settings tab (Blog post page path & Slug format) using my own perch:blog id's...
This last post here from Mark Fisher from the old forum outlines the exact issue:
http://forum.grabaperch.com/fo…ynamic-fields-in-template
Long story short as Drew mentions:
QuoteYou should be able to use any IDs from the post.html template in the post slug
However you currently cannot, the only id's which pull through are:
QuotepostID, blogID, postTitle, postSlug, postDateTime, postDescRaw, postDescHTML, postDynamicFields, postTags, postStatus, authorID, sectionID, postCommentCount, postImportID, postLegacyURL, postAllowComments, postTemplate, postMetaTemplate, postIsPublished, image, sectionTitle, SectionSlug, sectionPostCount, sectionDynamicFields, perch_image, blogTitle, blogSlug, setSlug and blogDynamicFields
Can this be added as a bug / feature request? I appreciate you can work around it in a couple of ways using perch_blog_custom() however to keep the View Post / View Draft buttons working correctly in the control panel you have to hijack / use one of the above, looks like postTags will work for me on this occasion.
-
As above. I'm currently rewriting it without Omnipay.
Hi drewm appreciate you're busy with this / V4 etc - any update on progress? Cheers
-
Believe you can still get a copy here: https://addons.perchcms.com/archive
-
Hi Drew,
I've asked and it was made a default for increased security.
It provides increased security and limits PHP opcache API calls to the path specified in that directive.
-
PHP 7.1
opcache.restrict_api no value no value PHP 7.3
opcache.restrict_api /restricted /restricted I see... The host has obviously changed the defaults between the version settings.
-
Hi, When I try a clean install of Perch 3.1.5 on PHP 7.3 I get the following:
Warning: Zend OPcache API is restricted by "restrict_api" configuration directive in /srv/users/folder/apps/app-name/public/customperchname/core/lib/PerchUtil.class.php on line 1427
Warning: Cannot modify header information - headers already sent by (output started at /srv/users/folder/apps/app-name/public/customperchname/core/lib/PerchUtil.class.php:1427) in /srv/users/folder/apps/app-name/public/customperchname/core/lib/PerchUtil.class.php on line 233Downgrading the server to PHP 7.1 solves the issue and installs with no errors.
I don't believe I am doing anything wrong / I believe this is a bug.
Note: Items in red abstracted for privacy.