Uploaded image for project: 'translate5'
  1. translate5
  2. TRANSLATE-2721

Call to a member function addChild() on null in QA tag handling

    XMLWordPrintable

Details

    • Bug
    • Resolution: Won't Fix
    • None
    • None
    • Auto-QA
    • High

    Description

      problem

      if $nearest is null is not handled properly:

      ERROR Error: E9999 - Call to a member function addChild() on null\n in core /var/www/translate5/application/modules/editor/Segment/FieldTags.php

      context

              foreach($clones as $tag){
                  // this "mechanic" is just to correct problems with singular tags on the right boundry of non-singular tags: The will be sorted right after the non-singular but may are nested into. We have to correct this ...
                  $nearest = $this->findHolderByOrder($processed, $tag);
                  if($nearest == NULL){
                      $nearest = $container->getNearestContainer($tag); // this is the "normal" way of nesting the sorted cloned tags
                  }
                  // Will log rendering problems
                  if(self::VALIDATION_MODE && $nearest == null){
                      error_log("\n============== HOLDER =============\n");
                      error_log($holder->toJson());
                      error_log("\n============== CONTAINER =============\n");
                      error_log($container->toJson());
                      error_log("\n============== TAG =============\n");
                      error_log($tag->toJson());
                      error_log("\n========================================\n");
                  }
      
       //HERE COMES THE PROBLEM on $nearest == null:
                  $nearest->addChild($tag);
      
      
                  $container = $tag;
                  $processed[] = $tag;
              }
      

      additional todo

      convert the error_log output to a error_log info message!

      Attachments

        Activity

          People

            axelbecher Axel Becher
            tlauria Thomas Lauria
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: