svrabel Posted July 17, 2014 Share Posted July 17, 2014 Working in 5.2.11 or 5.2.12, modifying the product causes the digital file to be deselected. This happens if I select Save or Save & Reload. Is this a known bug? It started after upgrading from 5.2.4. Quote Link to comment Share on other sites More sharing options...
bsmither Posted July 17, 2014 Share Posted July 17, 2014 It's not a problem that I know of. Even though the file name is in the list (I call it a File Picker), meaning it is probably referenced in the CubeCart_filemanager database table, please verify that the file actually exists where the File Manager says it is. This is just a shot in the dark. Quote Link to comment Share on other sites More sharing options...
Al Brookbanks Posted July 17, 2014 Share Posted July 17, 2014 I've not come across this either. Have you done a hard refresh to remove any older JS etc.. Quote Link to comment Share on other sites More sharing options...
svrabel Posted July 17, 2014 Author Share Posted July 17, 2014 @Al, I did a clean install on my local machine to test it. I'll try hard refresh, although I am uneasy to do that on a live site. There was nothing that showed up in the php error logs. Quote Link to comment Share on other sites More sharing options...
Al Brookbanks Posted July 17, 2014 Share Posted July 17, 2014 Sorry we are confusing our own terminologies. I meant a hard browser refresh. Windows: ctrl + F5Mac/Apple: Apple + R or command + R Quote Link to comment Share on other sites More sharing options...
svrabel Posted July 17, 2014 Author Share Posted July 17, 2014 Yes, I have refreshed the page. This has been going on for several weeks (since updating), but I was just informed by the person that does the product listings. Quote Link to comment Share on other sites More sharing options...
svrabel Posted July 20, 2014 Author Share Posted July 20, 2014 PHP:[Notice] /store/classes/request.class.php:255 - cURL Error (22): The requested URL returned error: 404 Not Found GET: '_g' => 'products' 'sort' => 'updated' => 'DESC' 'action' => 'edit' 'product_id' => '304' This is what debug is showing me when I'm in product manager. Quote Link to comment Share on other sites More sharing options...
bsmither Posted July 20, 2014 Share Posted July 20, 2014 This error comes from the fact that CubeCart may be asking for the RSS feed from a different URL. In admin, Store Settings, Layout tab, Default RSS URL for Admin Dashboard: http://forums.cubecart.com/rss/forums/1-cubecart-news-announcements/ When you first log in to the admin, CubeCart also makes a request to this URL: http://cp.cubecart.com/licence/version/X.Y.Z where X.Y.Z would be 5.2.12, for example. This request is to determine if you are running the latest version. In admin, Request Log, see if the request and 404 response is being logged. Quote Link to comment Share on other sites More sharing options...
svrabel Posted July 20, 2014 Author Share Posted July 20, 2014 Okay. I was grasping at straws for this issue. It makes it very difficult to list/edit products when I have to reselect the file after each change. I don't see anything in the Request Log for the 404 error. Quote Link to comment Share on other sites More sharing options...
bsmither Posted July 20, 2014 Share Posted July 20, 2014 The cURL error and the cause of the cURL error (probably) has nothing to do with the situation that is causing CubeCart to forget the digital file selection. You may want to submit a Trouble Ticket to Devellion. They should be able to discover why this is happening fairly quickly (but not on the weekends). Quote Link to comment Share on other sites More sharing options...
bsmither Posted July 20, 2014 Share Posted July 20, 2014 What is somewhat confusing is that you are getting the 404 error notice when you are editing a product. I now see that CubeCart will fetch a list of Google product types when the product is brought up for editing. Please read this conversation. Let us know if it applies to you. Still, this does not explain the reset digital file selection. Quote Link to comment Share on other sites More sharing options...
svrabel Posted July 20, 2014 Author Share Posted July 20, 2014 I just dug through the access logs, and it appears that the site isn't finding one of the images (images/menu_top_open.png), but I can't find any mention of it in any of the admin stylesheets. It's just strange. I'll go ahead and submit a trouble ticket. Quote Link to comment Share on other sites More sharing options...
ghinton Posted July 27, 2014 Share Posted July 27, 2014 I reported this back in February '?do=embed' frameborder='0' data-embedContent>> Quote Link to comment Share on other sites More sharing options...
bsmither Posted July 27, 2014 Share Posted July 27, 2014 I would very much like to have a report of what gets POSTed to CubeCart when editing a product and you click Save. Specifically when having chosen a file to make the product a 'digital' file, yet shows as 'tangible' at some time later. And it is when you make an edit at this later time (no changes to the digital file status) when the 'digital' state is lost. If you need instruction on how to get your browser to show you what was POSTed from the form, let me know. Quote Link to comment Share on other sites More sharing options...
bsmither Posted July 27, 2014 Share Posted July 27, 2014 I think I found a contributing factor to the problem: the digital file is in a subfolder. That is, when bringing the product up for editing a second time, the digital tab shows a filepicker window listing a folder, and you have to click on that folder (repeat as necessary) to see the actual file in the list. Can you confirm that the digital file assigned to this product is in a folder? Quote Link to comment Share on other sites More sharing options...
bsmither Posted July 27, 2014 Share Posted July 27, 2014 If so, then one solution (Devellion, please take note) is to make sure the filepicker window (the FileTree jQuery plugin) show the assigned file wherever it may be in the /files/ folder hierarchy - of which there can be only one digital file assigned in the current codebase - instead of having the filepicker start at the default /files/ folder. Quote Link to comment Share on other sites More sharing options...
bsmither Posted July 28, 2014 Share Posted July 28, 2014 The File Tree jQuery plugin is written specifically so that the filepicker window only records changes to the file assigned to the product. If there are no changes, there will be no POSTing of the 'download' form element. The 'download' form element contains an array of each listed file's FileManager index with either '1' or '0' as enabled. But, again, only if something changes. The current code does not properly handle a missing $_POST['download']. The current code assumes that no POST['download'] means that no file has been assigned (again, it actually means no changes to the choice of file assigned), and resets the product's digital status. It would be nice if the filepicker window could be coded to show the assigned file (especially if the file is in a subfolder), and also perhaps to return the currently assigned file as a POST['digital'] array of key/values. I think the immediate solution is to use the following code. In the file /admin/sources/products.index.inc.php, take note of lines 78 and 100. Those lines and all lines between, comment that range: Line 78 was: // Update product Now: /* // Update product Line 99-100 was: $record['digital'] = 0; // no path nor list of files } Now: $record['digital'] = 0; // no path nor list of files } */ Then add this code just above line 101: Line 101: $record['updated'] = date('Y-m-d H:i:s', time()); Add above: if (!empty($_POST['digital_path'])) { // Deal with the one thing that's guaranteed: a non-empty 'digital_path'. $record['digital'] = 1; $record['digital_path'] = $_POST['digital_path']; } else { // Otherwise, deal with the filepicker. // When 'download' is not set, the only thing this means is that the filepicker did not register a file choice change. // So, we must determine if an assignment is already in the database. if (!isset($_POST['download'])) { // So, no file choice changes, now to check if there was a previous assignment. if ($old_product_data[0]['digital']) { // There was a previous assignment. Keep it. $record['digital'] = $old_product_data[0]['digital']; } } else { // Otherwise, 'download' is set. // The filepicker recorded a change with respect to what file is associated with this product. // $_POST['download'] will contain an 'enable' and/or one or more 'disable'. // The filepicker records all "changes". We are only interested in the new 'enabled' choice. // If there is no new 'enable', 'digital' will remain zero. $record['digital'] = 0; foreach ($_POST['download'] as $key => $enabled) { if ($enabled) { // A file was newly enabled and will be assigned to 'digital'. $record['digital'] = $key; break; } } } } Quote Link to comment Share on other sites More sharing options...
Al Brookbanks Posted July 28, 2014 Share Posted July 28, 2014 Thanks for this Brian.. it's clearly a lot of work. I don't suppose anyone can try this and let us know how they get on? If its good we will do more testing and consider it for a next release. Quote Link to comment Share on other sites More sharing options...
svrabel Posted August 16, 2014 Author Share Posted August 16, 2014 Sorry for the delay. I've been busy with my day job. I just tried this and see no immediate problems. I will let you know if I run into any problems. Thanks for all your hard work Brian. 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.