<html>
    <head>
      <base href="https://bugs.documentfoundation.org/">
    </head>
    <body><span class="vcard"><a class="email" href="mailto:serval2412@yahoo.fr" title="Julien Nabet <serval2412@yahoo.fr>"> <span class="fn">Julien Nabet</span></a>
</span> changed
          <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - EDITING: Create as View not available before connecting to Database (open table, executing query, open form)"
   href="https://bugs.documentfoundation.org/show_bug.cgi?id=126578">bug 126578</a>
          <br>
             <table border="1" cellspacing="0" cellpadding="8">
          <tr>
            <th>What</th>
            <th>Removed</th>
            <th>Added</th>
          </tr>

         <tr>
           <td style="text-align:right;">CC</td>
           <td>
                
           </td>
           <td>lionel@mamane.lu, serval2412@yahoo.fr
           </td>
         </tr></table>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - EDITING: Create as View not available before connecting to Database (open table, executing query, open form)"
   href="https://bugs.documentfoundation.org/show_bug.cgi?id=126578#c8">Comment # 8</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - EDITING: Create as View not available before connecting to Database (open table, executing query, open form)"
   href="https://bugs.documentfoundation.org/show_bug.cgi?id=126578">bug 126578</a>
              from <span class="vcard"><a class="email" href="mailto:serval2412@yahoo.fr" title="Julien Nabet <serval2412@yahoo.fr>"> <span class="fn">Julien Nabet</span></a>
</span></b>
        <pre>On pc Debian x86-64 with master sources updated today, I could reproduce this.

After some debugging, the pb is in:
<a href="https://opengrok.libreoffice.org/xref/core/dbaccess/source/ui/app/AppController.cxx?r=7e403195#817">https://opengrok.libreoffice.org/xref/core/dbaccess/source/ui/app/AppController.cxx?r=7e403195#817</a>
808              case SID_DB_APP_CONVERTTOVIEW:
809                  aReturn.bEnabled = !isDataSourceReadOnly();
810                  if ( aReturn.bEnabled )
811                  {
812                      ElementType eType = getContainer()->getElementType();
813                      aReturn.bEnabled = eType == E_QUERY &&
getContainer()->getSelectionCount() > 0;
814                      if ( aReturn.bEnabled )
815                      {
816                          Reference<XViewsSupplier> xViewSup(
getConnection(), UNO_QUERY );
817                          aReturn.bEnabled = xViewSup.is() &&
Reference<XAppend>(xViewSup->getViews(),UNO_QUERY).is();
818                      }
819                  }

line 817 xViewSup.is() returns false since we haven't called "ensureConnection"
yet.
Opening a query or just going to Tables pane calls "ensureConnection", that's
why "Create as View" is available then.</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>