Re: Dynamic Price Updater
Hi,
thanks to Design75 for taking up with DPU.
I'm still looking for a solution to this problem:
[26-Mar-2014 05:07:01] PHP Warning: reset() expects parameter 1 to be array, null given in /.../includes/classes/dynamic_price_updater.php on line 175
[26-Mar-2014 05:07:01] PHP Warning: Variable passed to each() is not an array or object in /.../includes/classes/dynamic_price_updater.php on line 176
Actually It showes up only rarely, but still i'm unable to get why.
Tryed a couple of thing but nothing fixed the error and cause it seems just to generate the error log (no other problem found) I stepped over, but every time I see the error log it itches :blink:
If anyone have suggestion you are welcome :smile:
The site is http://www.laviadellincenso.it
Zencart 1.51
DPU 3.01
Re: Dynamic Price Updater
Any updates on the
[20-Apr-2014 09:58:00 UTC] PHP Warning: reset() expects parameter 1 to be array, null given in /var/xxxxx/includes/classes/dynamic_price_updater.php on line 175
[20-Apr-2014 09:58:00 UTC] PHP Warning: Variable passed to each() is not an array or object in /var/xxxxx/httpdocs/includes/classes/dynamic_price_updater.php on line 176
??
See it all the time in my error logs.
Re: Dynamic Price Updater
Hi all
I do apologise for my time away from supporting the Updater... I've been called back in to solve this issue with the error message logging... I hadn't been paying attention to the thread (work has taken the place where I once had a life)
As soon as I have a solution I will update the thread
Cheers
Dan
Re: Dynamic Price Updater
Hi all
I'm having some issues building a test environment, but I think I can fix this without it... Could I ask for volunteers?
Dan
Re: Dynamic Price Updater
Quote:
Originally Posted by
Chrome
Hi all
I'm having some issues building a test environment, but I think I can fix this without it... Could I ask for volunteers?
Dan
Here's one
1 Attachment(s)
Re: Dynamic Price Updater
Hi Design75
Sorry the time taken to respond; I decided to rewrite the fix... I'll also resubmit for verification after testing
File is attached
Thanks!
Dan
1 Attachment(s)
Re: Dynamic Price Updater
Hi all
I've added a few changes to the Updater's class file... Here are the changes:
- Changed the way the sidebox switch works (more a cosmetic/elegance alteration than anything, really)
- Fixed the errors caused by the reset() and each() calls (I hope)... This error was my making
- Altered the error logging method... Here I owe Design75 an apology as I incorrectly thought it was an example of bad design, but rather it's (I think) throwError() might be a magic function that's called in the event of any error in the class, rather than explicitly... It took me a while to figure out quite why the files were being created... After I figured this out I realised Design75's intention to alert the user to any error that had happened... I've added a drink icon as a peace offering to Design75 and my unreserved apologies... I'm sorry I reacted without fully checking and considering the situation... The logger now creates a single file in the logs folder and appends errors there
All that said, I've attached a replacement file for anyone that's kind enough to test it for me... The file only contains the affected class in its folder structure... Here's what needs to be tested:
- The _runDeep var that switches the sidebox on and off... This var is set in the class constructor
- The noted errors about reset() and each() to make sure they're squashed
- The new error logger... Easiest test is to manually call the logger directly, e.g. $this->throwError("Test error logger"); in the constructor
- The _runSilent flag that controls whether errors should be logged... Check that the log file is being created and it's in the correct place... Run the error test several times to ensure content is appending and not overwriting (this shouldn't be a problem)... Var is set in the constructor
All changes are commented but if anyone has any questions, please feel free to post here
Many thanks to everyone that tests and, again, my sincere apologies to Design75 (I really don't know where my head was)
Cheers
Dan
Re: Dynamic Price Updater
Quote:
Originally Posted by
Chrome
Hi all
I've added a few changes to the Updater's class file... Here are the changes:
- Changed the way the sidebox switch works (more a cosmetic/elegance alteration than anything, really)
- Fixed the errors caused by the reset() and each() calls (I hope)... This error was my making
- Altered the error logging method... Here I owe Design75 an apology as I incorrectly thought it was an example of bad design, but rather it's (I think) throwError() might be a magic function that's called in the event of any error in the class, rather than explicitly... It took me a while to figure out quite why the files were being created... After I figured this out I realised Design75's intention to alert the user to any error that had happened... I've added a drink icon as a peace offering to Design75 and my unreserved apologies... I'm sorry I reacted without fully checking and considering the situation... The logger now creates a single file in the logs folder and appends errors there
All that said, I've attached a replacement file for anyone that's kind enough to test it for me... The file only contains the affected class in its folder structure... Here's what needs to be tested:
- The _runDeep var that switches the sidebox on and off... This var is set in the class constructor
- The noted errors about reset() and each() to make sure they're squashed
- The new error logger... Easiest test is to manually call the logger directly, e.g. $this->throwError("Test error logger"); in the constructor
- The _runSilent flag that controls whether errors should be logged... Check that the log file is being created and it's in the correct place... Run the error test several times to ensure content is appending and not overwriting (this shouldn't be a problem)... Var is set in the constructor
All changes are commented but if anyone has any questions, please feel free to post here
Many thanks to everyone that tests and, again, my sincere apologies to Design75 (I really don't know where my head was)
Cheers
Dan
:laugh: No apologies needed. We al have our bad day, and you thought you were doing the right thing. I really appreciate you are back here and trying to make this module better. :hug:
Re: Dynamic Price Updater
Hi
Thank you Design75, I very much appreciate that :smile: :hug:
I've decided it's time to move the Updater forward... Firstly, an installer: To save mistakes and make it easier for newer users I plan to make an installer that sets the admin folder and template folder names and puts all the files in the correct place
Secondly, rather than digging about in the files for switches and changes, it's time for an admin page... Digging about in code files isn't for the faint of heart
So here are a few questions in anyone fancies a ponder:
- Should this version be a replacement (v4.0) or should it be a parallel version (offered at the same time as v3, which remains supported)? Is there a case for someone preferring or requiring the v3 over the installer version with admin panel?
- Apart from the standard switches (sidebox switch, error switch, quantity display switch etc.), what else could be added to help tweak and control the Updater? This can be anything from display to adding features that have never existed on the public side... So any feature request really
Thanks for all the support
Dan
Re: Dynamic Price Updater
The latest version already contain an auto installer. It is not the best, since this was one of my first modules to upgrade ;) At the same time I also moved most, if not all settings to the admin.
One feature I would like, and which I have not had the time to start on, is when there is a minimal amount of products that needs to be added to a cart, the updater does not update when opening the product_info page.
Quote:
Originally Posted by
Chrome
Hi
Thank you Design75, I very much appreciate that :smile: :hug:
I've decided it's time to move the Updater forward... Firstly, an installer: To save mistakes and make it easier for newer users I plan to make an installer that sets the admin folder and template folder names and puts all the files in the correct place
Secondly, rather than digging about in the files for switches and changes, it's time for an admin page... Digging about in code files isn't for the faint of heart
So here are a few questions in anyone fancies a ponder:
- Should this version be a replacement (v4.0) or should it be a parallel version (offered at the same time as v3, which remains supported)? Is there a case for someone preferring or requiring the v3 over the installer version with admin panel?
- Apart from the standard switches (sidebox switch, error switch, quantity display switch etc.), what else could be added to help tweak and control the Updater? This can be anything from display to adding features that have never existed on the public side... So any feature request really
Thanks for all the support
Dan