Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Started over and have some issues


Guest

Recommended Posts

Hi

 

So my hoster upgraded to php 5.6.4 and i started to get errors... i got most of them away, enough that customers can place an order

 

Anyway i'm not at v2.3.4 and i have some minor faults coming up in admin... not sure what contrib causing it but i can guess, but don't take my guessing as an personal attack

 

List of contribs: 

 

http://addons.oscommerce.com/info/8777 - Danish Language pack, no files changed

http://www.marcofolio.net/webdesign/php_random_image_rotation.html - Image rotator, used to show pics of the actual shop - one php file you link to that pick a random pic in same folder, no files changed either

 

http://addons.oscommerce.com/info/8156 - Ip recorder - these files are changed: 

 

admin:
- invoice.php
- packingslip.php
- orders.php
- includes/classes/orders.php
 
- admin/includes/languages/english/invoice.php
- admin/includes/languages/english/packingslip.php
- admin/includes/languages/english/orders.php
 
catalog:
- checkout_confirmation.php
- checkout_process.php
- includes/languages/english/checkout_confirmation.php
 
http://addons.oscommerce.com/info/7820 - database optmizer - these files are changed:
 
admin/includes/boxes/tools.php
admin/includes/languages/english.php 
admin/includes/database_tables.php 
admin/includes/filenames.php 
 
http://addons.oscommerce.com/info/7789 - Google Sitemap SEO - no files are changed
 
http://addons.oscommerce.com/info/7702 - Cron Simulator - So i can run database optmizer automatic - Hoster does not allow to run cron jobs - these files are changed:
 
admin/includes/languages/english.php
admin/includes/column_left.php
admin/includes/database_tables.php
admin/includes/filenames.php
admin/index.php
 
http://addons.oscommerce.com/info/1478 - Australian postage module, using it so i can make delivery charge depend on postal no - no files are changed
 
http://www.epay.dk/moduler-til-epay/oscommerce-ecommerce-betalingsmodul.asp - payment module for danish payment gateway - no files changed
 
 
Now the errors i get: 
 
Warning: Cannot modify header information - headers already sent by (output started at /var/www/pizzacapri.dk/test/admin/includes/languages/danish.php:1) in /var/www/pizzacapri.dk/test/admin/includes/functions/general.php on line 38
 
Fatal error: Cannot redeclare tep_db_connect() (previously declared in /var/www/pizzacapri.dk/test/admin/includes/functions/database.php:13) in /var/www/pizzacapri.dk/test/admin/includes/functions/database.php on line 27
 
the warning comes right after login at admin.. i can get past the error by adding index.php in the address bar...
cant remember what caused the fatal one... but will try and poke arround to get to it
 
will spend the day comparing danish and english translation.... if i need to provide a paste bin of files just let me know which ones, will check in now and then
 
 
Link to comment
Share on other sites

as i poked arround to get the 2nd error to show i discovered this strange thing in admin:

 

i first set language to danish and pick every item... then i set to english and start over...

 

in tools when i click database backup it goes back to danish.. i can go back and set to english and skip that one and admin stays in english

Link to comment
Share on other sites

hmm sadly there is not edit button, this might seem as an attempt to bumb but is not, if i could edit i would have done so

 

so i started to double check that all contribs are installed like instructed... first thing is note is with cron simulator... and i see some build in repair tool in 2.3.4 so i might not even need cronsimulator or database optimizer, but anyway...

 

Step 3 says:

 

before the first ?> if shop is 2.3 or hihger,
 
ADD:
 
 include(DIR_WS_BOXES . 'cron_simulator.php');
 
but if i do that cron simulator shows up twice... one at top and one at buttom.... so i will leave it out...
Link to comment
Share on other sites

checked everything... MACt is the only contrib i cant install fully

 

the warning only comes if admin language is set to danish... the fatal i cant reproduce 

Link to comment
Share on other sites

Warning: Cannot modify header information - headers already sent by (output started at /var/www/pizzacapri.dk/test/admin/includes/languages/danish.php:1) in /var/www/pizzacapri.dk/test/admin/includes/functions/general.php on line 38
Tells you the problem is at line 1 of the danish language file.

 

It is likely that you whitespace before the <?php

Link to comment
Share on other sites

checked that... no whitespace... but there was an empty line at end of file... corrected that

 

now without changing anything else i get this after login: Daglig => ERROR_INVALID_PERIOD

 

of course it something in the danish files.... but where did that come from all the sudden?

Link to comment
Share on other sites

well a new week is starting 4am for me so time to get offline and online in the real world...

 

if it can help i can post pastebins of as many files as needed... it only a test site for now so can even zip all the files minus the configs

 

hell i could even make the database anonymous and pack that in too...

Link to comment
Share on other sites

found something...

 

the danish language pack i use differ a bit from the english arround the orders and customers in admin

 

danish file:

 

// customers box text in includes/boxes/customers.php
define('BOX_HEADING_CUSTOMERS', 'Kunder');
define('BOX_CUSTOMERS_CUSTOMERS', 'Kunder');
define('BOX_CUSTOMERS_ORDERS', 'Ordrer');
 
english one:
 
// customers box text in includes/boxes/customers.php
define('BOX_HEADING_CUSTOMERS', 'Customers');
define('BOX_CUSTOMERS_CUSTOMERS', 'Customers');
 
// orders box text in includes/boxes/orders.php
define('BOX_HEADING_ORDERS', 'Orders');
define('BOX_ORDERS_ORDERS', 'Orders');
 
so when selecting danish i get one box for customers like in english... but the orders box look like this: 

 

   BOX_ORDERS_ORDERS

 

no problem for me i know what that one is for.... 

 

the trouble is i copy off from the english part and it looks ok... but as soon i do that i get this one when i logout and after login

 

Warning: Cannot modify header information - headers already sent by (output started at /var/www/pizzacapri.dk/test/admin/includes/languages/danish.php:1) in /var/www/pizzacapri.dk/test/admin/includes/functions/general.php on line 38

 

 

but with unmodded file it works

 

Link to comment
Share on other sites

If you keep getting a message that line 1 of danish.php is sending output, one of three things has happened:

1) you have a blank or tab before the opening <?php that you have overlooked

2) you have a UTF-8 Byte Order Mark that needs to be removed (you won't see it if your PC is editing in UTF-8 mode)

3) there is an error of some sort in or near the first line of danish.php. Check for ' outside of a string, etc.

Link to comment
Share on other sites

1)checked that many times.... i place the cursor just before the < and i try delete everything in front of it...

 

2) maybe edit from within admin? and not via filezilla/notepad 

 

3) will check further

Link to comment
Share on other sites

You probably won't see the BOM (3 bytes) unless you're editing/displaying the file in a single byte encoding such as Latin-1 or Windows-1252. I suspect your hosting editor or browser might not let you override its encoding and force Latin-1, but you can try. If you transfer the file to your PC, make sure you're not in UTF-8 mode to look at  the file with an editor.

 

A BOM is the very first thing in a file, if it was edited in UTF-8 and you didn't explicitly tell the editor not to save with BOM. It's usually not visible if your site admin/hosting panel/PC is itself displaying in UTF-8. One thing you might try when you get the list of errors starting with "Cannot modify header..." on your browser, is to force that page to "Western", Latin-1, Windows-1252, etc. single byte encoding... (browser View > Character set, etc.). Then the BOM should be visible at the very upper left.

 

What happens when there is a BOM in a file is that, being outside of the PHP block <?php ... ?>, it is treated as HTML text and sent immediately to the browser. The first text sent to the browser triggers the server to sent the HTTP Headers, and it is illegal to send any more changes to the headers after this point. So, if the BOM is way too early, before osC has finished updating the HTTP Headers to what it wants, you'll get this error.

 

Finally, note that saving a file containing UTF-8 characters (multibyte) will often result in the editor automatically adding a Byte Order Mark, unless you specifically tell it not to do so.

Link to comment
Share on other sites

I used the edit tool in admin and when i opened the files there they where empty.... not sure why because when i downloaded them via FTP and opened them in notepad they where ok

 

So what i did was simply copy+paste from notpad to the browser where i had the file open (and empty)... saved and it solved the problem

 

Now i just wish that i could edit language for admin the same way.... sure there is a contrib for it have not looked...

 

Also a the config part of admin is english only... i'm in the process of translating and editing in phpmyadmin... but really this should be in files... there are a pretty good language pack for 2.3.4, so i only need to translate very little..

 

 

Anyone knows if there are plans to move config from SQL to files?

Link to comment
Share on other sites

hmmm... just looked at my admin language files and strange enough the config part is translated.... but then why is is not used in admin?

 

I have stuff like this:

 

define('TEXT_CONFIG_SMALL_IMAGE_WIDTH', 'Lille Billed Bredde');
define('TEXT_CONFIG_SMALL_IMAGE_WIDTH_DESCRIPTION', 'Bredde i pixels på små billeder');
 
define('TEXT_CONFIG_SMALL_IMAGE_HEIGHT', 'Lille Billed Højde');
define('TEXT_CONFIG_SMALL_IMAGE_HEIGHT_DESCRIPTION', 'Højde i pixels på små billeder');
 
define('TEXT_CONFIG_HEADING_IMAGE_WIDTH', 'Kategori Billed Bredde');
define('TEXT_CONFIG_HEADING_IMAGE_WIDTH_DESCRIPTION', 'Bredde i pixels på kategoribilleder');
 
but its not used in admin... i can revert the changes i have done no problem
Link to comment
Share on other sites

i spoke to soon about the line 1 danish.php issue.... 

 

what editor could i use?

 

i'm on a windows pc

 

btw... 

 

general.php looks like this arround line 38:

 

////
// Redirect to another page or site
  function tep_redirect($url) {
    if ( (strstr($url, "\n") != false) || (strstr($url, "\r") != false) ) { 
      tep_redirect(tep_href_link(FILENAME_DEFAULT, '', 'NONSSL', false));
    }


    if ( (ENABLE_SSL == true) && (getenv('HTTPS') == 'on') ) { // We are loading an SSL page
      if (substr($url, 0, strlen(HTTP_SERVER . DIR_WS_HTTP_CATALOG)) == HTTP_SERVER . DIR_WS_HTTP_CATALOG) { // NONSSL url
        $url = HTTPS_SERVER . DIR_WS_HTTPS_CATALOG . substr($url, strlen(HTTP_SERVER . DIR_WS_HTTP_CATALOG)); // Change it to SSL
      }
    }


    if ( strpos($url, '&') !== false ) {
      $url = str_replace('&', '&', $url);
    }


    header('Location: ' . $url);


    tep_exit();
  }

could it be an ssl issue thing ?? 

 

nope that was not it... just a thought

 
 
 
 
Link to comment
Share on other sites

ahhh

 

filezilla uses notepad as editor... i just opted to save the file on desktop and sure enough it was saved as UTF-8.... picked ANSI and transfered file

 

problem gone

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...