Results 1 to 4 of 4

Thread: undefined index when creating custom quote template

  1. #1
    JVWay is offline Sugar Community Member
    Join Date
    Sep 2007
    Location
    Corvallis, Oregon
    Posts
    452

    Default undefined index when creating custom quote template

    Hi all,

    I was trying to follow the wiki on creating a custom quote. I've gone through it a number of times and it always results in the following error:

    Notice: Undefined index: QUOTE_TERMS in /var/www/sugar/modules/Quotes/layouts/Terms.php on line 356

    Warning: Cannot modify header information - headers already sent by (output started at /var/www/sugar/modules/Quotes/layouts/Terms.php:356) in /var/www/sugar/include/pdf/class.pdf.php on line 1920

    The second line is repeated a number of times.

    Line 356 is where I entered this line:
    $pdf->ezText($mod_strings['QUOTE_TERMS']);

    One question I have that's not real clear is if you already have an entry in en_us.lang.php where do you add the new string?

    Thw wiki states that you do this
    $mod_strings['QUOTE_TERMS'] = "\n\n\n\nPayment of invoices is due net 20 days unless approved otherwise. Sums not paid within 30 days from invoice date will incur interest at 15% per annum from due date until paid. \n\nAuthorized Signature:____________________________________ Date: ___________________";

    But if the file exists there is an array present. Do I do like it is below? Or do I create a new section for $mod_strings. I tried both and neither fixed it but maybe I need to do something else in conjunction.

    $mod_strings = array (
    'value' => 'Solution Relate',
    'LBL_SOLUTION_RELATE' => 'Solution Relate',
    'QUOTE_TERMS' => '\n\n\n\nPayment of invoices is due net 20 days unless approved otherwise. Sums not paid within 30 days from invoice date will incur interest at 15% per annum from due date until paid. \n\nAuthorized Signature:____________________________________ Date: ___________________',
    );

    Thanks very much for whatever help anyone can offer on this.
    Jerry Way
    Business Process Administrator

    Sugar 6.1.4 Professional
    (Testing 6.1.2)
    LAMP on Centos 5
    PHP 5
    MySQL 5
    Apache 2.2

  2. #2
    dsmithies is offline Sugar Community Member
    Join Date
    Mar 2008
    Posts
    19

    Default Re: undefined index when creating custom quote template

    Hi JVWay,

    I'm sorry to say that I don't have a solution to your problem, because I'm running into the same (or similar) problems.

    I do have a question for you though; Are you still able to 'Print to PDF' using the Invoice and Proposal options?

    I've broken all 3. All of my options give me the following error:

    Warning: Cannot modify header information - headers already sent by (output started at /mydomain/sugarcrm/custom/modules/Quotes/Layouts.php:13) in /mydomain/sugarcrm/include/pdf/class.pdf.php on line 1920

    and the same error for lines 1921, 1923, 1927, 1928, 1929. Followed by (what I assume is) PDF gibberish.

    I thought that I had followed the Wiki article exactly, but apparently I'm wrong!

    A strange fact is that there is no Line 13 in Layouts.php, it ends on line 12...

    I'm hoping that anyone who can assist you with fixing your custom invoice problem can help me too.

    I appreciate any suggestions!

    Thanks,
    Daniel Smithies

    Epoch Labs (Australia)
    daniel@epochlabs.com.au

    Ubuntu 8.04
    SugarCRM PRO 5.0.0d
    Apache 2.2.4
    PHP 5.2.3
    MySQL 5.0.45

  3. #3
    dsmithies is offline Sugar Community Member
    Join Date
    Mar 2008
    Posts
    19

    Default Re: undefined index when creating custom quote template

    Amazing! I solved my own problem

    Turns out that the header function didn't like blank line at the end of my Layouts.php. I was receiving an error on Line 13, which did not exist, but I noticed that line 12 was blank and outside of the line 11 ?> tag. I deleted this line and all of my invoices now work properly! Custom text and all.

    So, I suppose my advice is to remove the blank lines outside of the php closing tag in the file that is causing the error? I'm not 100% sure about this, and I don't know if it will help in your case JVWay...

    Although now that I think about it, JVWay, your problem might have to do with permissions. Did you chown the /custom/modules/Quotes/language/en_us.lang.php file to the correct owner? (Which I'm assuming is www-data:www-data or whatever your preference is?)

    One last tip: I'm pretty sure that the Wiki code starting with "$mod_strings['QUOTE_TERMS'] =" should be a separate entry in the custom en_us.lang.php file. You have it in an array which looks like it is used in another Module. Try starting a whole new section for the "$mod_strings['QUOTE_TERMS'] =" code.

    Hope this helps, let us know if it works for you!

    Thanks,
    Daniel Smithies

    Epoch Labs (Australia)
    daniel@epochlabs.com.au

    Ubuntu 8.04
    SugarCRM PRO 5.0.0d
    Apache 2.2.4
    PHP 5.2.3
    MySQL 5.0.45

  4. #4
    dsmithies is offline Sugar Community Member
    Join Date
    Mar 2008
    Posts
    19

    Default Re: undefined index when creating custom quote template

    Hi again JVWay,

    When I was transferring my setup from my test instance to my live one, I ran into the same problem as you are having. I'm pretty sure the only thing I did to fix it was to do a Quick Repair and Rebuild in the Admin interface. I could swear thats all I did, and it fixed it. Maybe you can give it a try?

    Good Luck!
    Daniel Smithies

    Epoch Labs (Australia)
    daniel@epochlabs.com.au

    Ubuntu 8.04
    SugarCRM PRO 5.0.0d
    Apache 2.2.4
    PHP 5.2.3
    MySQL 5.0.45

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. problemi step 6 di SugarSuite-Full-4.0.1h
    By lucia in forum Italiano
    Replies: 0
    Last Post: 2006-12-27, 08:50 AM
  2. Admin Tools for SugarCRM 4.2
    By kbrill in forum Downloads
    Replies: 80
    Last Post: 2006-09-22, 10:31 PM
  3. Errors after upgrade
    By mturany in forum Help
    Replies: 0
    Last Post: 2006-04-24, 04:40 AM
  4. ERROR in 4.01
    By rateck in forum Help
    Replies: 3
    Last Post: 2006-02-02, 10:00 PM
  5. Fatal error: Max
    By spokes2k4 in forum Help
    Replies: 3
    Last Post: 2006-01-15, 03:50 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •