Sharon123 Posted June 25, 2003 Share Posted June 25, 2003 Hi I have installed easy populate and when I go into Admin and click on the link I get this error: Fatal error: Cannot redeclare tep_get_tax_class_title() (previously declared in /www/virtual/crownk1w1/htdocs/admin/includes/functions/general.php:1109) in /www/virtual/crownk1w1/htdocs/admin/easypopulate_functions.php on line 34 Anyone have any ideas what this could mean? Thanks in advance Sharon Quote I know more than I did yesterday...If thats any help! Link to comment Share on other sites More sharing options...
halbert Posted June 25, 2003 Share Posted June 25, 2003 You need to comment out the line that calls easypopulate_functions.php. It's around line 309 or so: //******************************* // If you are running a pre-Nov1-2002 snapshot of OSC, then we need this include line to avoid // errors like: // undefined function tep_get_uploaded_file // if (!function_exists(tep_get_uploaded_file)){ // include ('easypopulate_functions.php'); Good luck! -al Quote Link to comment Share on other sites More sharing options...
Sharon123 Posted June 25, 2003 Author Share Posted June 25, 2003 Hi Thanks for your reply I removed the line you suggested But still have this error Parse error: parse error, unexpected '}' in /www/virtual/crownk1w1/htdocs/admin/easypopulate.php on line 305 I simply highlighted the text you suggested and deleted it. Is this the proper way? Many Thanks Sharon Quote I know more than I did yesterday...If thats any help! Link to comment Share on other sites More sharing options...
halbert Posted June 25, 2003 Share Posted June 25, 2003 Because it's an "if" statement the lines are surrounded by { and }. It seems that you left the following } character behind. The first { is just at the end of the "if"; the last should be just below the text you deleted. Delete the } and the problem should go away. -al Quote Link to comment Share on other sites More sharing options...
Sharon123 Posted June 25, 2003 Author Share Posted June 25, 2003 Thanks It works! Sharon Quote I know more than I did yesterday...If thats any help! Link to comment Share on other sites More sharing options...
Sharon123 Posted June 26, 2003 Author Share Posted June 26, 2003 Hi again Sorry but I am almost there Followed the instructions all going well but got this error after upload completed Fatal error: Call to undefined function: tep_get_uploaded_file() in /www/virtual/crownk1w1/htdocs/admin/easypopulate.php on line 708 Any help obviously apprieciated! Sharon Quote I know more than I did yesterday...If thats any help! Link to comment Share on other sites More sharing options...
Guest Posted June 26, 2003 Share Posted June 26, 2003 Hi Sharon I have the smae error, so i will watch your post and see how to fix! Quote Link to comment Share on other sites More sharing options...
Guest Posted June 30, 2003 Share Posted June 30, 2003 ditto that. i eagerly await a situation. Quote Link to comment Share on other sites More sharing options...
Guest Posted June 30, 2003 Share Posted June 30, 2003 sharon, i figured it out myself. Add the following code: function tep_get_uploaded_file($filename) { if (isset($_FILES[$filename])) { $uploaded_file = array('name' => $_FILES[$filename]['name'], 'type' => $_FILES[$filename]['type'], 'size' => $_FILES[$filename]['size'], 'tmp_name' => $_FILES[$filename]['tmp_name']); } elseif (isset($GLOBALS['HTTP_POST_FILES'][$filename])) { global $HTTP_POST_FILES; $uploaded_file = array('name' => $HTTP_POST_FILES[$filename]['name'], 'type' => $HTTP_POST_FILES[$filename]['type'], 'size' => $HTTP_POST_FILES[$filename]['size'], 'tmp_name' => $HTTP_POST_FILES[$filename]['tmp_name']); } else { $uploaded_file = array('name' => $GLOBALS[$filename . '_name'], 'type' => $GLOBALS[$filename . '_type'], 'size' => $GLOBALS[$filename . '_size'], 'tmp_name' => $GLOBALS[$filename]); } return $uploaded_file; } function tep_copy_uploaded_file($filename, $target) { if (substr($target, -1) != '/') $target .= '/'; $target .= $filename['name']; move_uploaded_file($filename['tmp_name'], $target); } Add the above code above this in easypopulate.php around line 698: if ($usrfl){ // move the file to where we can work with it $file = tep_get_uploaded_file('usrfl'); if (is_uploaded_file($file['tmp_name'])) { tep_copy_uploaded_file($file, DIR_FS_DOCUMENT_ROOT . $tempdir); } Everything should work fine after that. Quote Link to comment Share on other sites More sharing options...
halbert Posted July 1, 2003 Share Posted July 1, 2003 Whoops, ran into the same problem just the other day and noticed your posts. The alternative is to *uncomment* the code listed above, and then comment out the following code in easypopulate_functions.php: Around Line 35: /* *** Already declared, so remove this *** function tep_get_tax_class_title($tax_class_id) { if ($tax_class_id == '0') { return TEXT_NONE; } else { $classes_query = tep_db_query("select tax_class_title from " . TABLE_TAX_CLASS . " where tax_class_id = '" . $tax_class_id . "'"); $classes = tep_db_fetch_array($classes_query); return $classes['tax_class_title']; } } **** END **** removed function */ And your easypopulate.php code should look like this: Around Line 309 //******************************* // If you are running a pre-Nov1-2002 snapshot of OSC, then we need this include line to avoid // errors like: // undefined function tep_get_uploaded_file if (!function_exists(tep_get_uploaded_file)){ include ('easypopulate_functions.php'); } //******************************* The problem is that the easypopulate_functions.php file is trying to re-define the tep_get_tax_class_title() function which is already present. Good luck! -al Quote Link to comment Share on other sites More sharing options...
code dance Posted July 5, 2003 Share Posted July 5, 2003 I tried Easy Populate before and because I had modified it, it was suggested that I start over with a fresh copy. I have done this - and with a fresh install of OSCommerce, latest snapshot. I've had some parse errors on lines that were in the froogle part and I've commented out those lines. The error I get and always end up with - same problem before the fresh install of everything - is on the very last line of code. Actually it's for the line after the last line which doesn't even exist - just a simple parse error. I would really like this to work. Thanks Quote Link to comment Share on other sites More sharing options...
halbert Posted July 5, 2003 Share Posted July 5, 2003 I've been getting the same error at the end and have just been living with it. I can't be bothered to try and fix it as it's a small thing, and doesn't appear to cause grief. Make sure your text files don't have extra lines at the end though -- I had inadvertantly included about 10 lines with a few characters in them and this does cause an extra nonsense field to be inserted. Have a look in the Easy Populate 2.4 discussion and you'll see a few others have had this problem too. I don't think anyone did anything about it and the general consensus seemed to be that it's benign. I didn't get any errors with the froogle part though. Then again I don't use it. If you need to add extra fields to easy populate, I put my mods up as an example at the following link. I added the fields products_caratweight, products_gemlength, products_gemwidth, products_gemheight, products_dim_type, products_length, products_width, and products_height to the uploader. http:/www.frozenlightning.com/oscforums/easypopulatemod.zip -al Quote Link to comment Share on other sites More sharing options...
code dance Posted July 5, 2003 Share Posted July 5, 2003 Thanks Allan. I should mention 2 things - one, this installation got further along than the first time I tried it. The first time Easypopulate appeared in admin, but clicking on it brought up the series of parse errors. This time, clicking on Easypopulate in admin shows an Easypopulate page. So that's something I guess. I'd love to ignore the parse error as you suggested but the problem is that it is a problem - easypopulate doesn't go anywhere after that, just a gray screen with the parse error. This is when clicking on download to get started. The other thing is that I am using your mod for additional fields which seemed to make life easier. You have 8 additional fields listed, I did a search and replace for four of them and deleted the last four. I wonder if this has something to do with the parse errors. I have checked and made sure there is nothing on the last line - I have done everything I could think of. I have searched through all of these forum topics, I have read all of the easypopulate manual. Always ends with a parse error on the last line of the file. There seems to be a lot of extra stuff in easypopulate - hard to say, being appreciative of the tool and critical at the same time. Couldn't we have a simple, stripped down one, and one with everything but the kitchen sink for those who need it? Quote Link to comment Share on other sites More sharing options...
halbert Posted July 6, 2003 Share Posted July 6, 2003 Hmmmm. Don't know if what I did is causing the parse errors -- but I do know that my site uploads correctly. And updates existing records with modifications correctly as well. I haven't had a lot of time to think about EP as I have a couple other more pressing problems and EP seems to be working for me. Sorry if this is question seems basic, but have you created your extra fields in the database already? And have you checked their contents using phpMyAdmin or something like that to make sure they're being uploaded/updated correctly? :!: Hey wait a minute, are you getting the parse error before EP even tries to upload your file?? That means there's a code error somewhere in the easypopulate.php file. Could be a space or blank line before the beginning <?php or something like an extra or missing bracket somewhere. Post your error message and perhaps that will give a clue. Good luck! -al Quote Link to comment Share on other sites More sharing options...
halbert Posted July 6, 2003 Share Posted July 6, 2003 Just to be sure I zipped the right files, I've refreshed the zip. Try downloading them again and see if that helps anything. http://www.frozenlightning.com/oscforums/e...populatemod.zip -al Quote Link to comment Share on other sites More sharing options...
freezehell Posted July 6, 2003 Share Posted July 6, 2003 easy populate is cool! But can we mod this OPENDB so that we can add items like books, games, dvds....blah blah from amazon.com?? http://opendb.sourceforge.net You can get books or dvd..etc details from amazon.com into the database ...with just one click! Quote Link to comment Share on other sites More sharing options...
code dance Posted July 7, 2003 Share Posted July 7, 2003 Thanks again Allan. Your zipped files are identical. Yes, I never get to see Easypopulate work at all. I get a plain-gray-we're-not-going-anywhere-til-this-is-fixed type of error page that simply states: Parse error, path to easypopulate, then the line number which is always one line past the actual number of lines in the file, 1892 for example. I don't know php, but I've done a bit of coding and scripting and knew to look for a missing bracket - I've tried adding brackets, looking for other missing steps. Yes, I am using phpmyadmin and have added the fields in the database, have added catagories and one product to test with and these work. The only reason I tried easypopulate is because so many have said it works for them. Quote Link to comment Share on other sites More sharing options...
Daemonj Posted July 7, 2003 Share Posted July 7, 2003 Did you create the temp folder and give it appropriate rights, in addition to setting the entry in the easypopulate.php file? That is all that I can think of off the top of my head. Quote "Great spirits have always found violent opposition from mediocre minds. The latter cannot understand it when a man does not thoughtlessly submit to hereditary prejudices but honestly and courageously uses his intelligence." - A. Einstein Link to comment Share on other sites More sharing options...
halbert Posted July 7, 2003 Share Posted July 7, 2003 interesting error... sounds identical to one I was getting with a payment gateway I'm working on... Check that you've got all your commas in the right places -- it took me 2 days of ranting to sort this one out. I'd missed a comma in a function call and I'd get the same "parse error in line 290" with line 290 being the closing ?>. My error looked like this: tep_draw_hidden_field('post_dollaramount' $dollaramount) . instead of tep_draw_hidden_field('post_dollaramount', $dollaramount) . It's so subtle it took me ages to find it... So, I'd check in the places you've done your mods and make sure that you don't have a missing comma or quote/single quote. That's about all I can think of. Good luck!! -al Quote Link to comment Share on other sites More sharing options...
code dance Posted July 9, 2003 Share Posted July 9, 2003 Yes, temp is there, entered, and chmod 777. I really appreciate all the support. I looked around the areas where changes were made (field changes) and found nothing. I tried using Al's file with no changes except the url path required at the beginning of the froogle section. Temp directory is where it's supposed to be (catalog/temp). Didn't work. Then I tried a freshly unzipped easypopulate.php straight from the 2.60 zip. I got the following: Fatal error: Call to undefined function: tep_array_merge() in /home/shopthe/public_html/testore/admin/easypopulate.php on line 948 and line 948 is: $filelayout = tep_array_merge($filelayout , array( In the past what I've done was comment out the line since it is in the middle of a section I'm not using, but this time I am posting it here in case there's another option. Thanks again. Quote Link to comment Share on other sites More sharing options...
code dance Posted July 9, 2003 Share Posted July 9, 2003 I just read in another thread about "tep_array_merge" and "array_merge". I did the searchand replace and easypopulate, the unmod version so far, works. This is a major advance here. I'll let you know how the rest of it goes! Thanks. btw, this array_merge thing is needed for the new versions of oscommerce. 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.