lildog Posted September 30, 2007 Author Share Posted September 30, 2007 I know almost nothing about the different kinds of servers and their settings. I can however tell you what MAY be going wrong. And hopefully we can weed the problem out. This is the line that is failing in admin/contrib_tracker.php: vWritePageToFile('http://feeds.feedburner.com/osCommerce_Contributions?format=xml', DIR_WS_CATALOG. 'rsscache/contrib_rss.html'); I need to know what the value for DIR_WS_CATALOG. 'rsscache/contrib_rss.html' is on your system: on mine it is /catalog/rsscache/contrib_rss.html. Here is the first couple of lines of the function that are failing. There is not much to fail here. function vWritePageToFile($sHTMLpage, $sTxtfile ) { $sh=curl_init($sHTMLpage); $hFile=fopen($sTxtfile, 'w'); $sHTMLpage is the OSCOmmerce feed url it is correct unless you changed it. $sTxtfile is DIR_WS_CATALOG. 'rsscache/contrib_rss.html make sure this is the correct path curl_init($sHTMLpage)- When I looked this up it suggest trying a trailing slash on some servers. SO try this: change: admin/includes/functions/contrib_tracker.php vWritePageToFile('http://feeds.feedburner.com/osCommerce_Contributions?format=xml', DIR_WS_CATALOG. 'rsscache/contrib_rss.html'); to: vWritePageToFile('http://feeds.feedburner.com/osCommerce_Contributions?format=xml', DIR_WS_CATALOG. 'rsscache/contrib_rss.html/'); And then there is fopen($sTxtfile, 'w'); this creates and opens the file. Carefully check your paths I believe this is the problem. let me know lidog Quote Link to comment Share on other sites More sharing options...
mark27uk3 Posted October 1, 2007 Share Posted October 1, 2007 You were indeed correct my friend it was a path issue. It is working perfectly now, thank you Mark I know almost nothing about the different kinds of servers and their settings. I can however tell you what MAY be going wrong. And hopefully we can weed the problem out. This is the line that is failing in admin/contrib_tracker.php: vWritePageToFile('http://feeds.feedburner.com/osCommerce_Contributions?format=xml', DIR_WS_CATALOG. 'rsscache/contrib_rss.html'); I need to know what the value for DIR_WS_CATALOG. 'rsscache/contrib_rss.html' is on your system: on mine it is /catalog/rsscache/contrib_rss.html. Here is the first couple of lines of the function that are failing. There is not much to fail here. function vWritePageToFile($sHTMLpage, $sTxtfile ) { $sh=curl_init($sHTMLpage); $hFile=fopen($sTxtfile, 'w'); $sHTMLpage is the OSCOmmerce feed url it is correct unless you changed it. $sTxtfile is DIR_WS_CATALOG. 'rsscache/contrib_rss.html make sure this is the correct path curl_init($sHTMLpage)- When I looked this up it suggest trying a trailing slash on some servers. SO try this: change: admin/includes/functions/contrib_tracker.php vWritePageToFile('http://feeds.feedburner.com/osCommerce_Contributions?format=xml', DIR_WS_CATALOG. 'rsscache/contrib_rss.html'); to: vWritePageToFile('http://feeds.feedburner.com/osCommerce_Contributions?format=xml', DIR_WS_CATALOG. 'rsscache/contrib_rss.html/'); And then there is fopen($sTxtfile, 'w'); this creates and opens the file. Carefully check your paths I believe this is the problem. let me know lidog Quote Lifes a bitch, then you marry one, then you die! Link to comment Share on other sites More sharing options...
lildog Posted October 1, 2007 Author Share Posted October 1, 2007 Mark, Thank you for your reply. Where was the path wrong and is this something I could make more user friendly in the contrib so others do not encounter the same problem or just make more clear in the install intructions? You were indeed correct my friend it was a path issue. It is working perfectly now, thank you Mark Quote Link to comment Share on other sites More sharing options...
mark27uk3 Posted October 1, 2007 Share Posted October 1, 2007 Mark, Thank you for your reply. Where was the path wrong and is this something I could make more user friendly in the contrib so others do not encounter the same problem or just make more clear in the install intructions? My path was set incorrectly in catalog/configure.php Maybe it would be worth putting an example of an absolute url in the install docs just to reinforce the point. Mark Quote Lifes a bitch, then you marry one, then you die! Link to comment Share on other sites More sharing options...
elcidd Posted October 2, 2007 Share Posted October 2, 2007 My path was set incorrectly in catalog/configure.php Maybe it would be worth putting an example of an absolute url in the install docs just to reinforce the point. Mark I still can't get it to work. I don't know what you did to get the paths correct. I am running OSC 2.2 rc1. I don't have a catalog/configure.php file. I do have a catalog/includes/configure.php file. Can you clue me in to what you did to correct this? Thanks Lionel Quote Link to comment Share on other sites More sharing options...
sashaben Posted October 2, 2007 Share Posted October 2, 2007 I'm also getting this error, how did you fix it? Thanks Quote Link to comment Share on other sites More sharing options...
mark27uk3 Posted October 2, 2007 Share Posted October 2, 2007 I must have been half a sleep when I type that last reply lol Ok open your catalog/admin/includes/configure.php and look for DIR_WS_CATALOG and change it too this: define('DIR_WS_CATALOG', '/home/myaccountname/public_html/'); // absolute path required Obviously make sure you change the account name to mactch your own. Mark :thumbsup: Quote Lifes a bitch, then you marry one, then you die! Link to comment Share on other sites More sharing options...
sashaben Posted October 2, 2007 Share Posted October 2, 2007 I thought the error has something do with the path. What I did was change all instances of DIR_WS_CATALOG. 'rsscache/contrib_rss.html with DIR_FS_CATALOG. 'rsscache/contrib_rss.html Which I think does the same thing as you have done. But now I got this error. I'm using RC1. Warning: array_merge() [function.array-merge]: Argument #2 is not an array in /home/***/public_html/shop/admin/contrib_tracker.php on line 331 Warning: reset() [function.reset]: Passed variable is not an array or object in /home/***/public_html/shop/admin/includes/classes/object_info.php on line 17 Warning: Variable passed to each() is not an array or object in /home/***/public_html/shop/admin/includes/classes/object_info.php on line 18 Quote Link to comment Share on other sites More sharing options...
sashaben Posted October 2, 2007 Share Posted October 2, 2007 Never mind the problem above, I think it isn't related to this contribution. Quote Link to comment Share on other sites More sharing options...
sashaben Posted October 2, 2007 Share Posted October 2, 2007 Ok the error I posted above was a problem with the contribution, something to do with PHP5 compatibility. Anyways to fix it this is what I did In catalog & admin / contrib_tracker.php I changed all instances of DIR_WS_CATALOG. 'rsscache/contrib_rss.html to DIR_FS_CATALOG. 'rsscache/contrib_rss.html There was 6 in total For the PHP5 thing, in admin/contrib_tracker.php I changed $sInfo_array = array_merge($admin_quer, ''); To $sInfo_array = array_merge((array)$admin_quer); Seems to be working ok now Quote Link to comment Share on other sites More sharing options...
lildog Posted October 2, 2007 Author Share Posted October 2, 2007 Could someone verify the sashaben DIR_FS_CATALOG fix? If it is the best solution for all server configurations I will add it in. Thank everyone so far for your feedback it is a great help. Thank you, lildog Ok the error I posted above was a problem with the contribution, something to do with PHP5 compatibility. Anyways to fix it this is what I did In catalog & admin / contrib_tracker.php I changed all instances of DIR_WS_CATALOG. 'rsscache/contrib_rss.html to DIR_FS_CATALOG. 'rsscache/contrib_rss.html There was 6 in total For the PHP5 thing, in admin/contrib_tracker.php I changed $sInfo_array = array_merge($admin_quer, ''); To $sInfo_array = array_merge((array)$admin_quer); Seems to be working ok now Quote Link to comment Share on other sites More sharing options...
elcidd Posted October 2, 2007 Share Posted October 2, 2007 What I did in contrib_tracker.php was completely remove DIR_WS_CATALOG. 'rsscache/contrib_rss.html and replace it with the full path (which, by the way, is defined in DIR_FS_CATALOG). That worked perfect. However, when I came back here and read Mark's post, I tried it to see if that would work and yes it did work also. Using DIR_FS_CATALOG also solved the problem for me. So all three methods resolve this issue. Quote Link to comment Share on other sites More sharing options...
sashaben Posted October 2, 2007 Share Posted October 2, 2007 (edited) Looks like I messed up the update function, I'm not a programmer so I'm just guessing really. I'm think it's with that array thing I edited. Can anyone help out? Edited October 2, 2007 by sashaben Quote Link to comment Share on other sites More sharing options...
lildog Posted October 3, 2007 Author Share Posted October 3, 2007 sashaben I am only a moderate programmer but getting better. I will try to help out. What exactly is the problem? And what did you edit? Oh the array thing...array merge. I will check it out. What error are you getting now? elcidd Thank you I will change the contrib with the new path. lildog Quote Link to comment Share on other sites More sharing options...
lildog Posted October 3, 2007 Author Share Posted October 3, 2007 sashaben, It looks like the array_merge doesn't actually merge anything. $sInfo_array = array_merge($admin_quer, ''); the second variable is empty, I don't remember where that came from but will look into it, maybe it can just be deleted. Quote Link to comment Share on other sites More sharing options...
sashaben Posted October 3, 2007 Share Posted October 3, 2007 its around line 331 in admin/contrib_tracker.php I searched google and I think this is the proper way to do it $sInfo_array = array_merge((array)$admin_quer); If I delete it completely I get this error Warning: reset() [function.reset]: Passed variable is not an array or object in /home/sashaben/public_html/store/admin/includes/classes/object_info.php on line 17 Warning: Variable passed to each() is not an array or object in /home/sashaben/public_html/store/admin/includes/classes/object_info.php on line 18 Everything with this contribution seems to work (inserting etc.), except when I click edit and then try to update the details, it wipes all the details that were in there. Quote Link to comment Share on other sites More sharing options...
mickeymouse Posted October 4, 2007 Share Posted October 4, 2007 lildog, I think changing all references of DIR_WS_CATALOG to DIR_FS_CATALOG would be the best solution. It's possible that altering the config file to change the path of WS_CATALOG may break other contributions. FS seems to be the cleanest. I'm having the same problem as sashaben with the edit function. Insertion and deletion are all well. Editing seems to wipe out the record in the database. I'm setting up 2.2 RC1. Your version 1.54 works well on an older snapshot. I've got v1.54 running on another store usisng 2.2 ms2 and all is well. I couldn't really see any differences in the code from v1.54 to v1.6 that would cause this to happen so I tend to believe that OSC 2.2 RC1 is handling some things differently that is breaking the database update. I've tried installing v1.54 on 2.2 RC1 and have the same editing problem. Unfortunately I know just enough about php to to get me into a lot of trouble so I'm not much help in fixing the problem. Thanks Greg Quote I only do what my Rice Krispies tell me to do! Link to comment Share on other sites More sharing options...
mickeymouse Posted October 4, 2007 Share Posted October 4, 2007 ok...I've just confirmed that the edit problems are related to the way OSC 2.2 RC1 handles things. I just added another contribution called "Contribution Control and Bookmark" and it does the same thing. Inserting and deleting are fine. Editing the record doesn't work, it just deletes the information. Quote I only do what my Rice Krispies tell me to do! Link to comment Share on other sites More sharing options...
lildog Posted October 4, 2007 Author Share Posted October 4, 2007 Sashaben and mickeymouse, I too kinda bumble my way through the code, keep at it starts to get easier. Now, if i understand correctly about the array issue the error specifically mentions argument #2 right? That would be the '' in $sInfo_array = array_merge($admin_quer, ''). I just saw an example with only one array, by the way is probably nessesary to renumber the key elements, anyway the example was formatted llike so array_merge($a). So try this: $sInfo_array = array_merge($admin_quer). I am using ms2 not rc1 so I cannot help you. I believe rc1 is still alpha isn't it? Quote Link to comment Share on other sites More sharing options...
sashaben Posted October 4, 2007 Share Posted October 4, 2007 That still clears all the details as well. I'm pretty sure RC1 is stable its the only one you can download at the moment http://www.oscommerce.com/solutions/downloads Quote Link to comment Share on other sites More sharing options...
lildog Posted October 4, 2007 Author Share Posted October 4, 2007 Alright, but does it clear up this error? Warning: array_merge() [function.array-merge]: Argument #2 is not an array in /home/***/public_html/shop/admin/contrib_tracker.php on line 331 lildog Quote Link to comment Share on other sites More sharing options...
sashaben Posted October 4, 2007 Share Posted October 4, 2007 (edited) Changing the line to either $sInfo_array = array_merge($admin_quer); or $sInfo_array = array_merge((array)$admin_quer); Make no errors appear Edited October 4, 2007 by sashaben Quote Link to comment Share on other sites More sharing options...
lildog Posted October 8, 2007 Author Share Posted October 8, 2007 So where we stand is when you edit an existing record it clears the record? Does it completely erase the record from the database or just clear the fields? And does it generate any errors? lildog Changing the line to either$sInfo_array = array_merge($admin_quer); or $sInfo_array = array_merge((array)$admin_quer); Make no errors appear Quote Link to comment Share on other sites More sharing options...
sashaben Posted October 9, 2007 Share Posted October 9, 2007 It just clears all the fields when you try to update an item. It still there but it has no name etc. Doesn't show any errors. It does update the time for "Last official update" to the current time though. Quote Link to comment Share on other sites More sharing options...
lildog Posted October 10, 2007 Author Share Posted October 10, 2007 I appologize for all the questions...but, when you get to the page where you enter the updated info are the fields empty? I am trying to determine just how far the page is getting before it fails. lildog It just clears all the fields when you try to update an item.It still there but it has no name etc. Doesn't show any errors. It does update the time for "Last official update" to the current time though. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.