Roman_Pod Posted May 12, 2011 Share Posted May 12, 2011 Thanks in advance for sharing your thoughts on my problem! I installed fck editor, and it worked well without any problems. But then I added product tabs. And moved admin folder to other location because of security reasons. After that I cannot add new products or edit existing ones. After editing product descriptions in admin/catalog/categories I press "preview" button and get a lot of "Warning: No file uploaded!". Where should I look for problems\issues? I think, I put some wrong code on categories.php. Can I upload it here for analysis? Link to comment Share on other sites More sharing options...
KDM Posted May 12, 2011 Share Posted May 12, 2011 When you go to the preview screen you will see that message because at that point you have not updated anything. It is a preview screen. Do you see a update button on the screen? If so press it, that should update your product. I have always thought the message was misleading, maybe it should read something like "Press the update button to update product" Link to comment Share on other sites More sharing options...
Roman_Pod Posted May 12, 2011 Author Share Posted May 12, 2011 When you go to the preview screen you will see that message because at that point you have not updated anything. It is a preview screen. Do you see a update button on the screen? If so press it, that should update your product. I have always thought the message was misleading, maybe it should read something like "Press the update button to update product" KDM, Thanks for your idea. I strongly agree with you but I do not see any changes in text in preview mode. I do not see any changes in edited text after pressing "update" button either. That is why I think that after editing categories.php code I missed some functions inserting new text from editor to database. Any other ideas? Link to comment Share on other sites More sharing options...
KDM Posted May 12, 2011 Share Posted May 12, 2011 KDM, Thanks for your idea. I strongly agree with you but I do not see any changes in text in preview mode. I do not see any changes in edited text after pressing "update" button either. That is why I think that after editing categories.php code I missed some functions inserting new text from editor to database. Any other ideas? Does that mean you have added an add-on? If that is the case you should double check your changes and see if you missed anything. Do you have a file compare program? That could help a lot in locating the problem. I did an update on one of my products. When you get to the preview page check the page info. Right click (make sure not to click on image) on the page in: Firefox click on page info IE click on properties At the end of the page address do you see something like: ?cPath=319_320&pID=1930&action=new_product_preview If so then I think it would be in your update query, else it is in your get/post. This (get/post) I wouldn't think so. Check it out and see what you come up with. By the way I use osc version 2.2a. Link to comment Share on other sites More sharing options...
Roman_Pod Posted May 13, 2011 Author Share Posted May 13, 2011 Yes, I installed many add-ons. But this one was particularly painful. Yes, I see at the end of page address categories.php?cPath=23_21&pID=34&action=new_product_preview But update does not happen. My version is also 2.2. Link to comment Share on other sites More sharing options...
KDM Posted May 13, 2011 Share Posted May 13, 2011 Yes, I installed many add-ons. But this one was particularly painful. Yes, I see at the end of page address categories.php?cPath=23_21&pID=34&action=new_product_preview But update does not happen. My version is also 2.2. Load your catalog/admin/categories.php so I can view it. And moved admin folder to other location because of security reasons. Did you change the name or moved the folder? If you moved it did you update your path in catalog/admin/includes/configure.php? Link to comment Share on other sites More sharing options...
Roman_Pod Posted May 13, 2011 Author Share Posted May 13, 2011 Load your catalog/admin/categories.php so I can view it. I have sent it to you via private message. Did you change the name or moved the folder? If you moved it did you update your path in catalog/admin/includes/configure.php? For sure, I have updated paths in catalog/my_admin_folder/includes/configure.php. If I would not updated it, my admin section would not be accessible. Link to comment Share on other sites More sharing options...
KDM Posted May 13, 2011 Share Posted May 13, 2011 I have sent it to you via private message. I received your file. Part was missing toward the end. I've never checked before but if you can pm an attachment it would be best just to attach the file and you will not have to copy and paste. I think I have enough for what I need. The logic looks good. Should work. We know it doesn't so the question is it reaching the update logic. Here are two pieces of the code one updates the products file, the other the products description file. This is what you can try. 1 ) back up your categories.php just in case! 2 ) copy this code on a new line right after $sql_data_array = array_merge($sql_data_array, $update_sql_data);: echo "Products data array is: <br>"; print_r($sql_data_array); echo "<br>Products number is: $products_id<br>"; Go to admin store side and update any product you want. If you see data print out on the screen that means it got here and you product should be updating because the next line does the update ->> tep_db_perform(TABLE_PRODUCTS Makes sure that all the data is showing: products id, weight, model, price etc. If these two things are happening and the data is correct then there no obvious reason it shouldn't update. } elseif ($action == 'update_product') { $update_sql_data = array('products_last_modified' => 'now()'); $sql_data_array = array_merge($sql_data_array, $update_sql_data); tep_db_perform(TABLE_PRODUCTS, $sql_data_array, 'update', "products_id = '" . (int)$products_id . "'"); } 2 ) copy this code on a new line right after ($action == 'update_product') {: echo "Product description data array is: <br>"; print_r($sql_data_array); echo "<br>Product number is: $products_id<br>"; If you see data print out on the screen that means it got here and you product should be updating because the next line does the update ->> tep_db_perform(TABLE_PRODUCTS_DESCRIPTION Makes sure that all the data is showing: products id, image etc. If these two things are happening and the data is correct then there no obvious reason it shouldn't update. } elseif ($action == 'update_product') { tep_db_perform(TABLE_PRODUCTS_DESCRIPTION, $sql_data_array, 'update', "products_id = '" . (int)$products_id . "' and language_id = '" . (int)$language_id . "'"); } If you don't see the information on the screen then something is keeping it from getting to the update logic and more research will be needed. I suggest going to the forum listed below, I think this is what you have and maybe they will be able to help. This is not something I have loaded and without everything there is only so much I can do. Hopefully the path I've led you down will help. Let me know how it worked out some time. Good luck! Kerry FCK WYSIWYG HTML editor PS. Don't forget to take the added code out of the program. Link to comment Share on other sites More sharing options...
Roman_Pod Posted May 15, 2011 Author Share Posted May 15, 2011 If you don't see the information on the screen then something is keeping it from getting to the update logic and more research will be needed. Thank you very much for your help! I have tried exactly what you advised me to do. Unfortunately, updated categories.php code does not show any information on screen. Which way can you propose me to research further? Link to comment Share on other sites More sharing options...
KDM Posted May 16, 2011 Share Posted May 16, 2011 Thank you very much for your help! I have tried exactly what you advised me to do. Unfortunately, updated categories.php code does not show any information on screen. Which way can you propose me to research further? Of course I mentioned that forum. Try it. Your answer may be waiting for you. If you are determined to hunt it down yourself then you would need to: Starting at the beginning of the logic branch moving forward with your echo until it does echo. Or backward through the logic from the last place you tried it until the echo comes to screen. At that point you should then have an idea as to why it is following the logic that it is. This is the hardest and most boring part of coding as it is real easy to overlook the detail that made it (logic) go in the direction that it did. I almost forgot there is a debugging contribution out there by a good coder look here: KissER Error Handling & Debugging I haven't tried it myself, but I have faith in the coder. And if it works right it will beat copy, paste and removing code continually. Good luck. Link to comment Share on other sites More sharing options...
Roman_Pod Posted May 16, 2011 Author Share Posted May 16, 2011 KDM, great thanks for your suggestions! I think that I am on right way. Yesterday I experimented a bit and found out something that should get me closer to the solution. First, moving admin to other folder is not the issue. I tried to move it back to default folder and it does not work as should even in default folder. Second, I found that when I open categories.php to add new or edit existing product, it opens two fck editor fields at once. Second field was not remarked by me previously, because it is located at the most right position and it is needed to scroll to the right to find it. I tried to edit in this field and it has the same result (no update). But then I switched off FCK editor, and product description started to update from the most right "hidden" field. So, for today, I know for sure that it is error in categories.php code. Descriprtion is updatable from right field and with fck editor switched off. Also I tried to come back to code without product tabs and it works well with fck editor switched on! It should made debugging more easier. By the way, do you happen to know somebody who can help me to fix this for money? Link to comment Share on other sites More sharing options...
KDM Posted May 16, 2011 Share Posted May 16, 2011 I sent you a pm. Check it. Let me know what you think. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.