SMFHacks.com

SMF Classifieds => Support => Bugs => Topic started by: dan4ever on December 08, 2014, 09:23:56 am

Title: Getting " Undefined index" after upgrade...
Post by: dan4ever on December 08, 2014, 09:23:56 am
Hi

I'm getting a lot of Undefined index after upgrade to 4.0


Quote
http://www.guldforum.se/forum/index.php?action=classifieds;sa=editauction;id=22
8: Undefined index: secondpaypal
Fil: /storage/content/96/112396/guldforum.se/public_html/forum/Themes/default/Alerts.template.php (editauction sub template - eval?)
Rad: 5443

Quote
http://www.guldforum.se/forum/index.php?action=classifieds;sa=addlisting2
8: Undefined variable: topicOptions
Fil: /storage/content/96/112396/guldforum.se/public_html/forum/Sources/classifieds2.php
Rad: 7401


/Dan
Title: Re: Getting " Undefined index" after upgrade...
Post by: SMFHacks on December 08, 2014, 01:07:00 pm
New update
4.0.1
!Fixed undefined on add listing/add auction if you didn't have the insert into post option


For first issue might be a missing theme edit.
Title: Re: Getting " Undefined index" after upgrade...
Post by: dan4ever on December 08, 2014, 02:25:32 pm
For first issue might be a missing theme edit.
?????
Title: Re: Getting " Undefined index" after upgrade...
Post by: SMFHacks on December 08, 2014, 05:35:28 pm
Hmm lets see if we can find the true error line. Do the following
http://www.simplemachines.org/community/index.php?topic=290186.0

Then try to edit auction again and see if we get a different line number.
Title: Re: Getting " Undefined index" after upgrade...
Post by: dan4ever on December 08, 2014, 06:43:35 pm
No more error i think...

But have some from "Store" and you didn't had time to fix.

Quote
http://www.guldforum.se/forum/index.php?action=profile;area=account
8: Undefined index: store_storepaypal
Fil: /storage/content/96/112396/guldforum.se/public_html/forum/Themes/default/Alerts.template.php (edit_options sub template - eval?)
Rad: 1356

Quote
http://www.guldforum.se/forum/index.php?action=store;sa=myproducts
8: Undefined index: cannot_smfstore_userstore
Fil: /storage/content/96/112396/guldforum.se/public_html/forum/Sources/Security.php
Rad: 905

Quote
http://www.guldforum.se/forum/index.php?action=store;sa=contact
8: Undefined index: message
Fil: /storage/content/96/112396/guldforum.se/public_html/forum/Sources/Store2.php
Rad: 2978

/Dan4ever
Title: Re: Getting " Undefined index" after upgrade...
Post by: SMFHacks on December 08, 2014, 07:52:00 pm
Add this to your themes/default/languages/modifications.english.php file

Code: [Select]
$txt['cannot_smfstore_userstore'] = 'You are not allowed to manage your own store.';



The contact errror would only be logged if you access that link directly I see no other way. That link is only shown on the myorders page form.
Title: Re: Getting " Undefined index" after upgrade...
Post by: dan4ever on December 09, 2014, 06:03:27 am
And the last error I get in store is:

Quote
http://www.guldforum.se/forum/index.php?action=profile;area=account;u=1220
8: Undefined index: store_storepaypal
Fil: /storage/content/96/112396/guldforum.se/public_html/forum/Themes/default/Alerts.template.php (edit_options sub template - eval?)
Rad: 1356
Title: Re: Getting " Undefined index" after upgrade...
Post by: SMFHacks on December 09, 2014, 08:41:25 am
Can you do http://www.simplemachines.org/community/index.php?topic=290186.0
Title: Re: Getting " Undefined index" after upgrade...
Post by: dan4ever on December 09, 2014, 09:02:39 am
Yes, the "eval" dissapeard...
but it looks like this now:

Quote
http://www.guldforum.se/forum/index.php?action=profile;area=account;u=325
8: Undefined index: store_storepaypal
Fil: /storage/content/96/112396/guldforum.se/public_html/forum/Themes/default/Profile.template.php
Rad: 1356

And if I click on the last file in the error I get this:

Quote
1344:                if (allowedTo('smfstore_userstore') == true || allowedTo('smfstore_manage') == true)
1345:                {
1346:                  echo '
1347:                           <dl>';
1348:            
1349:                  
1350:                     echo '
1351:                              <dt>
1352:                                 <strong>', $txt['smfstore_paypal_address'], '</strong><br />
1353:                                 <span class="smalltext"></span>
1354:                              </dt>
1355:                              <dd>
==>1356:                                 <input type="text" name="default_options[store_storepaypal]" size="50" value="', $context['member']['options']['store_storepaypal'], '" />
1357:                              </dd>';
1358:                  
1359:            
1360:                  echo '
1361:                  </dl>';
1362:            }
Title: Re: Getting " Undefined index" after upgrade...
Post by: SMFHacks on December 09, 2014, 11:20:57 am
Replace the part of the line with
Code: [Select]
<input type="text" name="default_options[store_storepaypal]" size="50" value="', isset($context['member']['options']['store_storepaypal']) ? $context['member']['options']['store_storepaypal'] : '', '" />
Title: Re: Getting " Undefined index" after upgrade...
Post by: dan4ever on December 09, 2014, 05:16:17 pm
Thanks!!!!!
Title: Re: Getting " Undefined index" after upgrade...
Post by: dan4ever on December 09, 2014, 05:19:05 pm
Can you do http://www.simplemachines.org/community/index.php?topic=290186.0


Is it ok to keep the "disable eval()"?   or should I turn it on again?
Title: Re: Getting " Undefined index" after upgrade...
Post by: SMFHacks on December 09, 2014, 05:22:02 pm
It's ok to keep it like that I do on my sites.
Title: Re: Getting " Undefined index" after upgrade...
Post by: dan4ever on December 09, 2014, 05:26:49 pm
OK, Thanks!!!!