|
|
adminAdministrator809 posts
The SELECT 1 is used twice in the db class of the store module and in only 3 other locations in Cheetah.
My understanding is that the SELECT 1 is used to check if a record exists; is my understanding correct?
If the record looked up via the select is found, it will return 1 other wise it will not. So yes. Basically, but works even if more than one record matches, they all will return 1.
|
|
The SELECT 1 is used twice in the db class of the store module and in only 3 other locations in Cheetah.
My understanding is that the SELECT 1 is used to check if a record exists; is my understanding correct? |
|
adminAdministrator809 posts
I have no idea of the usage of MariaDB over MySQL; some of the Linux distro will now install MariaDB as the default database server.
It's very common now. MariaDB is included now by default in most all major distros. So MySQL is pretty much dead as far as i am concerned. The only ones that would be using MySQL now would be those using a very old distro, or are using it by choice.
Anyhow. The SELECT 1 is used twice in the db class of the store module and in only 3 other locations in Cheetah. But those do not seem to be having a problem. This one however appears to be the only one that also returns true or false by combining a ternary if with the database select which may be why it was not working properly.
|
|
I still need to get to the PayPal payments module to fix it.
I am still working the next release update. Family health issues with my mother has chewed up a lot of my time and has slowed down my progress.
Anyhow for the store module try this and see what happens.
Edit modules\cheetah\store\classes\ChStoreDb.php
Look for the function isPurchasedItem at about line 160 and replace with this.
function isPurchasedItem($iClientId, $iFileId) { return $this->getOne("SELECT `file_id` FROM `" . $this->_sPrefix . "customers` WHERE `file_id` = '$iFileId' AND `client_id` = '$iClientId' LIMIT 1") ? true : false; }
I Replaced the SELECT 1 with SELECT `file_id` because it's not evaluating properly. I believe it's a issue with MariaDB which i think evaluates expressions like that differently than MySQL does.
So as long as the purchased product is actually in the ch_store_customers table than that should fix the download button issue.
Dude your mom comes first, the fact that you took the time to reply back to GG and provide a fix, speaks HIGHLY of your dedication to your project and support to your members. I'm not going to mention any names, but some other developers have their nose so deep in UNA a** they have lost their sense of smell to individuals who own 90% of their modules. As for you my brother, keep up the great work and the members here are supporting you bro! Mom comes first brother!
|
|
Anyhow for the store module try this and see what happens.
Your change appears to have fixed the issue with being able to download the product. Thank you. Now to see if I can get the shop module by Modzzz corrected.
|
|
I believe it's a issue with MariaDB which i think evaluates expressions like that differently than MySQL does.
Yes, I run MariaDB on all my servers in place of MySQL. When MariaDB first came out, it was a direct replacement drop-in for MySQL. However, with the acquisition of MySQL by Oracle (through the acquisition of Sun Microsystems,) development on MySQL started to lag so MariaDB decided to move ahead with improving MariaDB even if it meant that it would no longer be a one-to-one replacement. Up to now, I have not had any real issues with using MariaDB with Cheetah. I have no idea of the usage of MariaDB over MySQL; some of the Linux distro will now install MariaDB as the default database server. |
|
adminAdministrator809 posts I still need to get to the PayPal payments module to fix it.
I am still working the next release update. Family health issues with my mother has chewed up a lot of my time and has slowed down my progress.
Anyhow for the store module try this and see what happens.
Edit modules\cheetah\store\classes\ChStoreDb.php
Look for the function isPurchasedItem at about line 160 and replace with this.
function isPurchasedItem($iClientId, $iFileId) { return $this->getOne("SELECT `file_id` FROM `" . $this->_sPrefix . "customers` WHERE `file_id` = '$iFileId' AND `client_id` = '$iClientId' LIMIT 1") ? true : false; }
I Replaced the SELECT 1 with SELECT `file_id` because it's not evaluating properly. I believe it's a issue with MariaDB which i think evaluates expressions like that differently than MySQL does.
So as long as the purchased product is actually in the ch_store_customers table than that should fix the download button issue.
|
|
I am still having issues with the paypal payments allowing access to the store (and shop) modules. Today I switched PayPal payments from direct mode to using PDT mode. We tested buying membership upgrades and it all went well. A member was able to purchase a membership upgrade, the payment went through, both on the site and in the PayPal account. The member's new membership was applied. Therefore, it seems that PDT is working to check out a membership and send information back to Cheetah that the payment was successful and applied the new membership level.
However, in both the store module (and Modzzz's Shop module), even though the payment goes through and the payment shows up both in the member's payment processed in their Account page, and in the member's PayPal account, the download buttons do not become active. How can I test why the member is not able to download the store product even though the payment was successful? Since it is broken in both the built-in store module and in the third party shop module, perhaps something else outside of the store module is preventing the download button from being active. Has anyone tested the store module?
|
|