View ProjeQtOr On SourceForge.net
ProjeQtOr - Project Management Tool
Support us on Capterra
OIN - Open Invention Network
ProjeQtOr free project management software - Undefined variable in "importable.php" - ProjeQtOr
 
 

Undefined variable in "importable.php"

More
14 Oct 2013 15:17 #1 by caccia
Hi again,

I encountered an "undefined variable" error while attempting to import a CSV file.
In file importable.php, the variable $line is initialized within an if() clause (around line 225):
if (count($fields) > count($title)) {
   $line="";
   foreach($fields as $field){
      $line.=$field." ;; ";
   ...

Below this, $line is used outside of this if() clause (l.243):
          $htmlResult.= $line;
          $htmlResult.= '</td>';

I guess $line should be at least initialized outside of the if().

Note: encountered this when using one CSV file to import Actions, where:
- first few lines were updating status of existing actions
- then some lines to create new actions (ID field empty)

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

More
16 Oct 2013 12:53 #2 by babynus
Hi,

Ticket #1202 recorded to fix this issue.

For information :
- the proposed fix is not complete, not only $line must be initizalized, but also completed (including the foreach loop)
- you face this issue because your import file contains no numeric data for id. I guess you entered some spaces for blank ids, and this led to the issue. I then also added fix to remove spaced from id...

Thanks for reporting.
Babynus

Babynus
Administrator of ProjeQtOr web site

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

More
16 Oct 2013 16:53 #3 by caccia
Thanks for the information - on the file and on the fix ! :)
I knew it was caused by a problem on the file, but wasn't sure what exactly...

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

Moderators: babynusprotion
Time to create page: 0.046 seconds

Cookies settings

×

Functional Cookies

Ce site utilise des cookies pour assurer son bon fonctionnement et ne peuvent pas être désactivés de nos systèmes. Nous ne les utilisons pas à des fins publicitaires. Si ces cookies sont bloqués, certaines parties du site ne pourront pas fonctionner.

Session

Please login to see yours activities!

Other cookies

Ce site web utilise un certain nombre de cookies pour gérer, par exemple, les sessions utilisateurs.