title: Why does an OR-Condition load double, when a Single-Condition load once in TypoScript Condition?
body: <p>I created a custom TYPO3-Condition <a href="https://stackoverflow.com/a/49690175/7209206">here</a>.</p>
  
  <p>If I use the Condition this way:</p>
  
  <pre><code>## Custom JavaScript Includes for LogoClaim Backendlayout
  [RM\RmBase\TypoScript\BackendlayoutCondition = pagets__pagelayout_logoclaim_portal] || [RM\RmBase\TypoScript\BackendlayoutCondition = pagets__pagelayout_logoclaim_subpage]
      page.includeJSFooter.belayoutJavascript = EXT:rm_base/Resources/Public/JS/be_logoclaim.js
  [global]
  
  ## Custom JavaScript Includes for LogoFull Backendlayout
  [RM\RmBase\TypoScript\BackendlayoutCondition = pagets__pagelayout_logofull_portal] || [RM\RmBase\TypoScript\BackendlayoutCondition = pagets__pagelayout_logofull_subpage]
      page.includeJSFooter.belayoutJavascript = EXT:rm_base/Resources/Public/JS/be_logofull.js
  [global]
  </code></pre>
  
  <p>I get 8 Debugs from: <code>\TYPO3\CMS\Extbase\Utility\DebuggerUtility::var_dump($conditionParameters,'cond Params');</code>.</p>
  
  <p>If I use it single:</p>
  
  <pre><code>## Custom JavaScript Includes for LogoClaim Backendlayout
  [RM\RmBase\TypoScript\BackendlayoutCondition = pagets__pagelayout_logoclaim_portal]        
      page.includeJSFooter.belayoutJavascript = EXT:rm_base/Resources/Public/JS/be_logoclaim.js
  [global]
  [RM\RmBase\TypoScript\BackendlayoutCondition = pagets__pagelayout_logoclaim_subpage]
      page.includeJSFooter.belayoutJavascript = EXT:rm_base/Resources/Public/JS/be_logoclaim.js
  [global]
  
  ## Custom JavaScript Includes for LogoFull Backendlayout
  [RM\RmBase\TypoScript\BackendlayoutCondition = pagets__pagelayout_logofull_portal]        
      page.includeJSFooter.belayoutJavascript = EXT:rm_base/Resources/Public/JS/be_logofull.js
  [global]
  [RM\RmBase\TypoScript\BackendlayoutCondition = pagets__pagelayout_logofull_subpage]
      page.includeJSFooter.belayoutJavascript = EXT:rm_base/Resources/Public/JS/be_logofull.js
  [global]
  </code></pre>
  
  <p>I get four debugs.</p>
  
  <p>Logical the Condition is called 8 times in the OR-Variant and 4 times in the Single-Call-Variant.</p>
  
  <hr>
  
  <p>My Idea was less redundant code, but it looks like a double-checking condition. So based on performance I better should use the Single-Call-Conditions?</p>
  
  <p>What's the PROs and the CONs for this or that?</p>
  
  <hr>
  
  <p><strong>Edit</strong></p>
  
  <p>My Condition Code:</p>
  
  <pre><code>&lt;?php
  namespace RM\RmBase\TypoScript;
  
  use \TYPO3\CMS\Core\Configuration\TypoScript\ConditionMatching\AbstractCondition;
  
  use TYPO3\CMS\Core\Database\ConnectionPool;
  use TYPO3\CMS\Core\Utility\GeneralUtility;
  use TYPO3\CMS\Extbase\Object\ObjectManager;;
  
  class BackendlayoutCondition extends AbstractCondition
  {
      /**
       * Evaluate condition
       *
       * @param array $conditionParameters
       * @return bool
       */
      public function matchCondition(array $conditionParameters)
      {
          # Return false if in Backend (Condition for Frontend only)
          if (!$GLOBALS['TSFE']) return false;
  \TYPO3\CMS\Extbase\Utility\DebuggerUtility::var_dump($conditionParameters,'cond Params');        
          # QueryBuilder for Table: pages
          $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)-&gt;getQueryBuilderForTable('pages');
  
          # Check if current BackendLayout is inside the $conditionParameters
          if (!empty($conditionParameters) &amp;&amp; substr($conditionParameters[0], 0, 1) === '=') {
              # Trim the Parameter to get the correct Value of the Parameter (behind '=')
              $conditionParameters[0] = trim(substr($conditionParameters[0], 1));
  
                  # Get Backendlayout on this Page
                  $backendLayoutOnThisPage = $queryBuilder
                      -&gt;select('backend_layout')
                      -&gt;from('pages')
                      -&gt;where(
                          $queryBuilder-&gt;expr()-&gt;eq('uid', $queryBuilder-&gt;createNamedParameter(intval($GLOBALS['TSFE']-&gt;id), \PDO::PARAM_INT))
                      )
                      -&gt;execute();
  
              # Store Backendlayout Value of the current Page in $backendLayoutOnThisPage
              $backendLayoutOnThisPage = $backendLayoutOnThisPage-&gt;fetch()['backend_layout'];
          } else {
              # If no ConditionParameter was set return false
              return false;
          }
  
          # Check if parent BackendLayout_NextLevel is inside the $conditionParameters
          if ($backendLayoutOnThisPage == '') {
              # Get pageRepository
              $objectManager = GeneralUtility::makeInstance(ObjectManager::class);
              $pageRepository = $objectManager-&gt;get('TYPO3\\CMS\\Frontend\\Page\\PageRepository');
  
              # Get Rootline of the current Page
              $pageRootline = $pageRepository-&gt;getRootLine(intval($GLOBALS['TSFE']-&gt;id));
  
              # Set rootlineIndex to the Parent Page Index
              $rootlineIndex = count($pageRootline)-2;
  
              # Check Parent Page Backendlayout_NextLevel till 0 or Backendlayout found
              while ($rootlineIndex &gt; 0) {
                  if ($pageRootline[$rootlineIndex]['backend_layout_next_level'] == $conditionParameters[0]) {
                      return true;
                  } else {
                      $rootlineIndex--;
                  }
              }
  
              # No BackendLayout_NextLevel found till 0
              return false;
          } else {
              # If Condition Backendlayout found return true, otherwise return false
              if ($backendLayoutOnThisPage == $conditionParameters[0]) {
                  return true;
              } else {
                  return false;
              }
          }
      }
  }
  </code></pre>