Skip to Content Skip to Menu

Attachement Plugin: undefined index

  • Netto
  • Netto
  • OFFLINE
  • Posts: 7
  • Thanks: 0
  • Karma: 0
13 years 6 months ago #161080 by Netto
I've installed the premium plugin attachement.php
When I create a message (with or without an attachement), there is a warning:

Notice: Undefined index: extension in /.../components/com_uddeim/attachment.php on line 50 Notice: Undefined index: extension in /.../components/com_uddeim/attachment.php on line 50 Notice: Undefined index: extension in .../components/com_uddeim/attachment.php on line 50


What can I do?

my site: www.kulturbuero-goettingen.de
Using Eventlis, Stalytics2, Vemod Newsmailer
Joomla 1.5 with:
CommunityBuilder with CB Activity, CbMailing, GroupJive, CBSubs
Kunena Forum, Remsitory, Shoutbox, UddeIM, JEvents,

Please Log in or Create an account to join the conversation.

  • slabbi
  • slabbi
  • OFFLINE
  • Posts: 3709
  • Thanks: 250
  • Karma: 153
13 years 6 months ago - 13 years 6 months ago #161096 by slabbi
Replied by slabbi on topic Re: Attachement Plugin: undefined index
It is not a warning (or bug). It seems that your php.ini is configured also to report "notices" which are irrelevant.

-- from php manual --
Note:

Enabling E_NOTICE during development has some benefits. For debugging purposes: NOTICE messages will warn you about possible bugs in your code. For example, use of unassigned values is warned. It is extremely useful to find typos and to save time for debugging. NOTICE messages will warn you about bad style. For example, $arr[item] is better to be written as $arr since PHP tries to treat "item" as constant. If it is not a constant, PHP assumes it is a string index for the array.

"pathinfo" is exactly used the way the php manual describes ( de2.php.net/pathinfo ). Nevertheless the notice might only be displayed when an attachment is added (it is a first time report and I also use the plugin on several sites with notices on).

Switch off "notices" in your php.ini or add
www.php.net/manual/en/function.error-reporting.php
at the beginning of the script.

uddeIM & uddePF Development
CB Language Workgroup
CB 3rd Party Developer
Last edit: 13 years 6 months ago by slabbi.

Please Log in or Create an account to join the conversation.

  • slabbi
  • slabbi
  • OFFLINE
  • Posts: 3709
  • Thanks: 250
  • Karma: 153
13 years 6 months ago #161103 by slabbi
Replied by slabbi on topic Re: Attachement Plugin: undefined index
A workaround for this nasty php behavior is also
Code:
$temp = pathinfo($name); $ext = ""; if (isset($temp['extension']) $ext = $temp['extension'];

I modified the code so the "notice" is not longer displayed. I reported this bug to php dev in order that they return an empty variable instead of an unset one.

uddeIM & uddePF Development
CB Language Workgroup
CB 3rd Party Developer

Please Log in or Create an account to join the conversation.

Moderators: beatnantslabbikrileon
Powered by Kunena Forum