TYPO3 Extbase: Get related disabled/hidden object

ext_localconf.php

$extbaseObjectContainer = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(
    \TYPO3\CMS\Extbase\Object\Container\Container::class
);
$extbaseObjectContainer->registerImplementation(
    \TYPO3\CMS\Extbase\Persistence\Generic\QueryFactoryInterface::class,
    \Vendor\Extensionname\Persistence\Generic\QueryFactory::class
);

Object Vendor\Extensionname\Persistence\Generic\QueryFactory.php

<?php
namespace Vendor\Extensionname\Persistence\Generic;

use Vendor\Extensionname\Domain\Model\Objectname;


class QueryFactory extends \TYPO3\CMS\Extbase\Persistence\Generic\QueryFactory
{

    public function create($className)
    {
        $query = parent::create($className);
        if (is_a($className, Objectname::class, true)) {

            $query->getQuerySettings();

            $querySettings = $query->getQuerySettings();
            $querySettings->setIgnoreEnableFields(true);

        }
        return $query;
    }
}

Load formular with ajax and display it in fancybox lightbox

Just a code snippet:

The link:

<a href="#" id="the-opener-link" data-url="/link/to/form">Open form</a>

The JavaScript:

$('#the-opener-link').click(function(event) {

    $.fancybox.open({
        href:$(this).attr('data-url'),
        type: 'ajax',
        afterShow: function() {
            $(".fancybox-inner form").bind("submit", function () {
                $.fancybox.showLoading();
                $.ajax({
                    type: "POST",
                    cache: false,
                    url: $(this).attr('action'),
                    data: $(this).serializeArray(),
                    success: function (data) {
                        $.fancybox(data);
                    }
                });
                return false;
            });
        }
    });

    return false;
});

I’m using a data attribute to protect the form being indexed and used by bots/search engines.