Giter Site home page Giter Site logo

contao-node's Issues

Contao 5.3 Fehler bei NodesPicker

hallo, ich versuche den NodesPicker in Contao5 bei News einzubinden. Dabei entsteht folgende Fehlermeldung.

[2024-02-22T18:45:06.769367+01:00] request.CRITICAL: Uncaught PHP Exception TypeError: "str_replace(): Argument #3 ($subject) must be of type array|string, null given" at NodePickerWidget.php line 81 {"exception":"[object] (TypeError(code: 0): str_replace(): Argument #3 ($subject) must be of type array|string, null given at /www/htdocs/w01e8696/editiondasausland.com/vendor/terminal42/contao-node/src/Widget/NodePickerWidget.php:81)"} {"request_uri":"https://editiondasausland.com/contao?act=edit&do=news&id=3&ref=7jsQEf_s&rt=14d4290fe45900d175d37411.txbhWfImz6mHmqN3OcaWkdaBUHdG1JCliRqpHsbGSCQ.42KYLogemfvs7tMca6fi3qzFCAMEtebi3XXnTf-LIneEQKwtsVOH0Oaskw&table=tl_news","request_method":"GET"}

Mein Code für die DCA sieht wie folgt aus

// Node
$GLOBALS['TL_DCA']['tl_news']['fields']['node'] = [
	'label'                   	=> &$GLOBALS['TL_LANG']['tl_news']['node'],
	'exclude' 					=> true,
	'inputType' 				=> 'nodePicker',
	'eval' 						=> ['multiple' => true, 'fieldType' => 'checkbox', 'tl_class' => 'clr', 'includeBlankOption' => true],
	'sql' 						=> ['type' => 'blob', 'notnull' => false],
];

Was soll ich machen, um dies zu beseitigen?

Unknown column 'tags' in 'field list'

Right after a fresh install (1.0.1) accessing the backend module:

An exception occurred while executing 'SELECT DISTINCT `tags` FROM tl_node':
SQLSTATE[42S22]: Column not found: 1054 Unknown column 'tags' in 'field list'

Stacktrace:

Doctrine\DBAL\Exception\InvalidFieldNameException:
An exception occurred while executing 'SELECT DISTINCT `tags` FROM tl_node':

SQLSTATE[42S22]: Column not found: 1054 Unknown column 'tags' in 'field list'

  at vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php:80
  at Doctrine\DBAL\Driver\AbstractMySQLDriver->convertException('An exception occurred while executing \'SELECT DISTINCT `tags` FROM tl_node\':SQLSTATE[42S22]: Column not found: 1054 Unknown column \'tags\' in \'field list\'', object(PDOException))
     (vendor/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php:184)
  at Doctrine\DBAL\DBALException::wrapException(object(Driver), object(PDOException), 'An exception occurred while executing \'SELECT DISTINCT `tags` FROM tl_node\':SQLSTATE[42S22]: Column not found: 1054 Unknown column \'tags\' in \'field list\'')
     (vendor/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php:158)
  at Doctrine\DBAL\DBALException::driverExceptionDuringQuery(object(Driver), object(PDOException), 'SELECT DISTINCT `tags` FROM tl_node', array())
     (vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php:943)
  at Doctrine\DBAL\Connection->executeQuery('SELECT DISTINCT `tags` FROM tl_node')
     (vendor/contao/core-bundle/src/Resources/contao/library/Contao/Database/Statement.php:277)
  at Contao\Database\Statement->query()
     (vendor/contao/core-bundle/src/Resources/contao/library/Contao/Database/Statement.php:251)
  at Contao\Database\Statement->execute(array())
     (vendor/contao/core-bundle/src/Resources/contao/drivers/DC_Table.php:5633)
  at Contao\DC_Table->filterMenu(1)
     (vendor/contao/core-bundle/src/Resources/contao/classes/DataContainer.php:1154)
  at Contao\DataContainer->panel()
     (vendor/contao/core-bundle/src/Resources/contao/drivers/DC_Table.php:349)
  at Contao\DC_Table->showAll()
     (vendor/contao/core-bundle/src/Resources/contao/classes/Backend.php:618)
  at Contao\Backend->getBackendModule('nodes', null)
     (vendor/contao/core-bundle/src/Resources/contao/controllers/BackendMain.php:169)
  at Contao\BackendMain->run()
     (vendor/contao/core-bundle/src/Controller/BackendController.php:48)
  at Contao\CoreBundle\Controller\BackendController->mainAction()
     (vendor/symfony/http-kernel/HttpKernel.php:150)
  at Symfony\Component\HttpKernel\HttpKernel->handleRaw(object(Request), 1)
     (vendor/symfony/http-kernel/HttpKernel.php:67)
  at Symfony\Component\HttpKernel\HttpKernel->handle(object(Request), 1, true)
     (vendor/symfony/http-kernel/Kernel.php:198)
  at Symfony\Component\HttpKernel\Kernel->handle(object(Request), 1, true)
     (src/HttpKernel/AppCache.php:50)
  at App\HttpKernel\AppCache->handle(object(Request))
     (public/index.php:33)

Error: Node of folder type cannot have content elements

I have a content node and inside there is a single text element with some content in it.

If I add a link to the text, everything works fine if I choose a "page" or a "file" with the picker. If I add a "news" element or an "event" element and save the content element, it will result to the error shown above. I guess it would be the same with a "faq" element.

The node it self is inside a node-folder, but it makes no difference if I move it outside a node folder. I have the latest contao-node version installed on a Contao 4.4.42 LTS.

Kind regards,
Sares

Show node name in article listing of content elements

If you add a content node as a content-element to your articles, it shows the content of the node's first content element in the listing as description. I think it would be better, if the "name" of the node would be displayed instead.

Hope it is clear what I mean :-)

If not:

  • create a new content node
  • name it f.e. "testnode" and add some content elements to it
  • go to articles and add the testnode to an article
  • in the listing you will see, that it will not show "Nodes -> testnode", but the content of the first generated content element, whatever it is f.ex. "Nodes -> Some text".

Kind regards,
Sares

Feature import/export

Schön wäre eine Import/Export Möglichkeit ala .cto zur Nutzung in versch. Installationen.
Wäre dies technisch überhaupt möglich?

The folder nodes are not allowed

If you select a node of type folder in content element "Nodes", you get this error: The folder nodes are not allowed. Should folders not be selectable then? Or is it something the picker currently cannot do? 🤔

Attempted to load class "Table" from the global namespace. Did you forget a "use" statement?

On a nearly empty 5.04 (e.g. Contao plus the Rocksolid theme stuff) I get the following back end error if I try to open the nodes menu:

Stack Trace:
Symfony\Component\ErrorHandler\Error\ClassNotFoundError:
Attempted to load class "Table" from the global namespace.
Did you forget a "use" statement for e.g. "Symfony\Component\Console\Helper\Table", "Spatie\SchemaOrg\Table", "League\CommonMark\Extension\Table\Table", "Doctrine\ORM\Mapping\Table" or "Doctrine\DBAL\Schema\Table"?

  at vendor/contao/core-bundle/contao/classes/Backend.php:294
  at Contao\Backend->getBackendModule()
     (vendor/contao/core-bundle/contao/controllers/BackendMain.php:149)
  at Contao\BackendMain->run()
     (vendor/contao/core-bundle/src/Controller/BackendController.php:44)
  at Contao\CoreBundle\Controller\BackendController->mainAction()
     (vendor/symfony/http-kernel/HttpKernel.php:153)
  at Symfony\Component\HttpKernel\HttpKernel->handleRaw()
     (vendor/symfony/http-kernel/HttpKernel.php:75)
  at Symfony\Component\HttpKernel\HttpKernel->handle()
     (vendor/symfony/http-kernel/Kernel.php:202)
  at Symfony\Component\HttpKernel\Kernel->handle()
     (public/index.php:44)   

Benutzergruppenverwaltung

Hallo,

leider kommt es derzeit zu einem Fehler, wenn ich die Benutzergruppen bearbeiten möchte. Ich nutze 1.5.10, Contao 4.13.14 und PHP 8.0.x

[2022-12-16T13:28:11.232150+01:00] request.CRITICAL: Uncaught PHP Exception Error: "Cannot create references to/from string offsets" at /homepages/u2652/www/contao4/var/cache/prod/contao/dca/tl_node.php line 13 {"exception":"[object] (Error(code: 0): Cannot create references to/from string offsets at /homepages/u2652/www/contao4/var/cache/prod/contao/dca/tl_node.php:13)"} []

Define filters for each node

I evaluating to replace psi/boxes4ward with this extension. Boxes4ward isn't maintained really actively that's why I'm looking for an alterantive.

With boxes4ward it is possible to select pages as white- or blacklist on which the nodes should be visible. Also inherit this setting to supages is possible.

Would you accept it as a feature? I'd provide a PR for it.

CSS-ID/Class settings are ignored

If you add a content-node to an article, it would be great, if you would check if there are some expert-settings available (CSS-ID/Classes) and output them to the frontend.

Right now the ce_nodes.html template only includes:

<?= implode("\n", $this->nodes) ?>

and therefore the CSS-ID/Class settings are ignored.
I like it, that nothing else is added to the output, but in this case I would expect an additional div container.

Best regards,
Sares

onNodesSaveCallback does not work with mandatory => false

If you have a DCA field like this:

'nodes' => [
    'label' => …,
    'exclude' => true,
    'inputType' => 'nodePicker',
    'eval' => ['mandatory' => false, 'multiple' => true, 'fieldType' => 'checkbox', 'tl_class' => 'clr'],
    'sql' => ['type' => 'blob', 'notnull' => false],
    'save_callback' => [
        ['terminal42_node.listener.content', 'onNodesSaveCallback'],
    ],
],

You'll run into the following error when saving without any defined nodes:

Argument 1 passed to Terminal42\NodeBundle\EventListener\ContentListener::onNodesSaveCallback() must be of the type string, null given, called in …\vendor\contao\core-bundle\src\Resources\contao\drivers\DC_Table.php on line 3111

Not sure what the best way to fix this is, without removing the string type of the first parameter of onNodesSaveCallback.

// edit: ah, we can simply use

public function onNodesSaveCallback(?string $value, DataContainer $dc): string

Limit access of node content elements to specific user-groups

Nowadays, your articles often look like this:

-wrapper start
---grid start
-----text-element
---grid stop
---grid start
-----gallery-element
---grid stop
-wrapper stop
...

To have the possibility now to organize things like that in virtual folders and nodes is a big improvement and will reduce complexity in the articles-listing a lot.

However, normally, editors should only have access to the "inner" elements "text" and "gallery" in most cases, as shown in the example above. So maybe the bundle could be extended to define, if a content element should be visible / editable by a user/user-group or not.

If so, editing the node will result in a listing like this:

-----text-element
-----gallery-element

and the "complexity" of the outer structure will be hidden and a lot of admins would sleep much better I think :-)

What do you think?

Kind regards,
Sares

Add more options

Please add some more options to make the nodes a replacement for inserttags extension:

  • Limit pages

  • Show guests only

  • Protect node

  • Timing

  • Condition

  • Counter

Great would be the possibility to insert nodes directly in page layouts without having to create a module first and insert this module.

Add Pagination

If many nodes are displayed, an option for pagination, like other list modules (news, events...) would be useful.

System update fails in Contao Manager

vendor/bin/contao-console list
In FileLocator.php line 71:
                                                                               
  The file "services.yml" does not exist (in: "/home/user/public_html/example.com/vendor/terminal42/contao-node/src/DependencyInjection/../  
  Resources/config").

Copy node doesn't copy content elements

I don't know if this is a bug or a non-existing feature :-)

If you make a copy of an existing node the included content elements are not copied and the new node has no content elements at all.

Best regards,
Sares

Contao 5.04: Non-existent service "session".

On a clean Contao 5.04 installation I get the following with Nodes v 1.5.11:
The service "terminal42_node.listener.data_container" has a dependency on a non-existent service "session". Did you mean one of these: "argument_resol ver.session", "session.storage.factory.native", "session_listener", "securi ty.authentication.session_strategy", "security.listener.session.contao_back end", "security.logout.listener.session.contao_backend", "security.listener .session.contao_frontend", "security.logout.listener.session.contao_fronten d", "contao.listener.clear_session_data", "contao.listener.user_session", " contao.session.factory", "contao.session.contao_backend", "contao.session.c ontao_frontend", "contao.session.factory.inner"?

Any clues for me?

German translation

I'd like to provide a PR for the German translation. However I wanted to ask what you prefer: do you want to translate the word "node" as well? Imho we could call it "node" in German too - because calling it "Knoten" everywhere sounds just awful ;)

Vererbung der Node Mounts wird nicht berücksichtigt

System:
CONTAO: 4.9.28
contao-node: 1.5.6

Beschreibung:
Wenn man einem Benutzer einen Mountpoint auf einen Ordner gibt und dieser anschließend den Fokus auf ein Inhaltsfragment legt, erscheint folgende Fehlermeldung:

An exception occurred while executing 'SELECT DISTINCT 'type' FROM tl_node WHERE id IN()': SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 1

Schritte zum reproduzieren:

  1. einen Ordner-Node anlegen
  2. in diesem einen Inhalts-Node anlegen
  3. einem Benutzer nur den Ordner-Node als Node-Mount geben
  4. mit diesem Benutzer auf den Namen des Inhalts-Nodes klicken, um ihn zu "fokussieren"

Vermutlich beziehen sich die Bugs #27 und #28 ebenfalls auf dieses Verhalten. Zumindest ist die Fehlermeldung die gleiche.

Internal Server Error

Habe das Problem auch unter der Version 1.4
Wenn ich bei dem betroffenen Benutzer die Session-Daten via Benutzerprofil lösche, geht es kurzfristig wieder.

An exception occurred while executing 'SELECT DISTINCT `type` FROM tl_node WHERE id IN()': SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ')' at line 1

Originally posted by @ngdot in #27 (comment)

Non-existent service

I've updated terminal42/contao-node to version 1.3.0 and got this error:

In CheckExceptionOnInvalidReferenceBehaviorPass.php line 86:
                                                                               
  The service "terminal42_node.listener.data_container" has a dependency on a  
   non-existent service "codefog_tags.manager.terminal42_node". 

The codefog/tags-bundle is installed at version 3.1.1.

Contao 5.3 - introduce support for nested elements

When an element group is included in a node and I want to edit the child elements, I currently get an error message.

image

Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException:
Node of folder type cannot have content elements

  at vendor/symfony/security-http/Firewall/ExceptionListener.php:136
  at Symfony\Component\Security\Http\Firewall\ExceptionListener->handleAccessDeniedException(object(ExceptionEvent), object(AccessDeniedException))
     (vendor/symfony/security-http/Firewall/ExceptionListener.php:103)
  at Symfony\Component\Security\Http\Firewall\ExceptionListener->onKernelException(object(ExceptionEvent), 'kernel.exception', object(TraceableEventDispatcher))
     (vendor/symfony/event-dispatcher/Debug/WrappedListener.php:116)
  at Symfony\Component\EventDispatcher\Debug\WrappedListener->__invoke(object(ExceptionEvent), 'kernel.exception', object(TraceableEventDispatcher))
     (vendor/symfony/event-dispatcher/EventDispatcher.php:220)
  at Symfony\Component\EventDispatcher\EventDispatcher->callListeners(array(object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener)), 'kernel.exception', object(ExceptionEvent))
     (vendor/symfony/event-dispatcher/EventDispatcher.php:56)
  at Symfony\Component\EventDispatcher\EventDispatcher->dispatch(object(ExceptionEvent), 'kernel.exception')
     (vendor/symfony/event-dispatcher/Debug/TraceableEventDispatcher.php:139)
  at Symfony\Component\EventDispatcher\Debug\TraceableEventDispatcher->dispatch(object(ExceptionEvent), 'kernel.exception')
     (vendor/symfony/http-kernel/HttpKernel.php:239)
  at Symfony\Component\HttpKernel\HttpKernel->handleThrowable(object(AccessDeniedException), object(Request), 1)
     (vendor/symfony/http-kernel/HttpKernel.php:91)
  at Symfony\Component\HttpKernel\HttpKernel->handle(object(Request), 1, true)
     (vendor/symfony/http-kernel/Kernel.php:197)
  at Symfony\Component\HttpKernel\Kernel->handle(object(Request))
     (public/index.php:44)

If I comment out lines 71 - 73 in the "ContentListener.php", I can edit the entries.

if (!$type || NodeModel::TYPE_FOLDER === $type) {
throw new AccessDeniedException('Node of folder type cannot have content elements');
}

Unable to hide content-element - Contao 4.13 RC2

In Contao 4.13 RC2 können Inhaltselemente die innerhalb von Nodes erstellt werden nicht über das Auge ausgeblendet werden. Das graue Auge erscheint zwar, aber nach dem Reload im Browser ist es wieder grün und im Frontend wird das Element dann natürlich auch nicht ausgeblendet.
Contao 4.13 RC2
Node 1.5.2
XAMPP mit PHP 7.4.27
Windows 10

Gegencheck in einer 4.12 zeigt, dass das Ausblenden dort funktioniert.
Contao 4.12.5
Node 1.5.2
PHP 7.4.27
Hostingwerk

Adding tags with leading number(s) will fail

I've tried to add some new content-node tags and run into a problem.

An exception occurred while executing 'INSERT INTO tl_cfg_tag_node (node_id, cfg_tag_id) VALUES ('38', '4-3s')': SQLSTATE[01000]: Warning: 1265 Data truncated for column 'cfg_tag_id' at row 1

I added something like this: 4-3s, but I also tried 2-grid etc. Seems, that leading numbers cause some insert problems.

Best regards,
Sares

Seitenauswahl hinzufügen?

Besteht die Möglichkeit z. B. in der Node und/oder im Modul der Node eine Options-Gruppe für eine Seitenauswahl hinzuzufügen. So kann individuell bestimmt werden, auf welchen Seiten der Node ausgegeben wird und man benötigt keine zusätzlichen Seitenlayouts, um die Zuordnung zu regeln.

page-selection

Internal Server Error

Contao 4.11.2
Nodes 1.3.3

Hallo,
User ohne Administartionsrechte haben immer mal wieder Schwierigkeiten Nodes wegen eines internen Serverfehlers aufzurufen.
Leider habe ich es noch nicht geschafft, den Fehler reproduzierbar herzustellen.

An exception occurred while executing 'SELECT DISTINCT type FROM tl_node WHERE id IN()': SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ')' at line 1

Ich habe dazu ein Video angefertigt.
https://user-images.githubusercontent.com/1572887/115617696-01263a80-a2f2-11eb-87c8-09e8d0d98fbf.mp4

Warning: Attempt to read property "nodes" on array

In content element "Nodes", when I select nodes in the picker and click "Apply" – that AJAX request fails with server error (500) in dev environment with PHP 8.1. The reason is the PHP 8 Warning: Attempt to read property "nodes" on array:

ErrorException:
Warning: Attempt to read property "nodes" on array

  at vendor/terminal42/contao-node/src/EventListener/DataContainerListener.php:321
  at Terminal42\NodeBundle\EventListener\DataContainerListener->reloadNodePickerWidget(object(DC_Table))
     (vendor/terminal42/contao-node/src/EventListener/DataContainerListener.php:260)
  at Terminal42\NodeBundle\EventListener\DataContainerListener->onExecutePostActions('reloadNodePickerWidget', object(DC_Table))
     (vendor/contao/core-bundle/src/Resources/contao/classes/Ajax.php:527)
  at Contao\Ajax->executePostActionsHook(object(DC_Table))
     (vendor/contao/core-bundle/src/Resources/contao/classes/Ajax.php:509)
  at Contao\Ajax->executePostActions(object(DC_Table))
     (vendor/contao/core-bundle/src/Resources/contao/classes/Backend.php:429)
  at Contao\Backend->getBackendModule('article', null)
     (vendor/contao/core-bundle/src/Resources/contao/controllers/BackendMain.php:168)
  at Contao\BackendMain->run()
     (vendor/contao/core-bundle/src/Controller/BackendController.php:49)
  at Contao\CoreBundle\Controller\BackendController->mainAction()
     (vendor/symfony/http-kernel/HttpKernel.php:152)
  at Symfony\Component\HttpKernel\HttpKernel->handleRaw(object(Request), 1)
     (vendor/symfony/http-kernel/HttpKernel.php:74)
  at Symfony\Component\HttpKernel\HttpKernel->handle(object(Request), 1, true)
     (vendor/symfony/http-kernel/Kernel.php:202)
  at Symfony\Component\HttpKernel\Kernel->handle(object(Request))
     (public/index.php:44)

When I fix src/EventListener/DataContainerListener.php:321 to use array notation instead, then the next code block fails with another warning:

ErrorException:
Warning: Undefined array key "load_callback"

  at vendor/terminal42/contao-node/src/EventListener/DataContainerListener.php:326
  at Terminal42\NodeBundle\EventListener\DataContainerListener->reloadNodePickerWidget(object(DC_Table))
     (vendor/terminal42/contao-node/src/EventListener/DataContainerListener.php:260)
  at Terminal42\NodeBundle\EventListener\DataContainerListener->onExecutePostActions('reloadNodePickerWidget', object(DC_Table))
     (vendor/contao/core-bundle/src/Resources/contao/classes/Ajax.php:527)
  at Contao\Ajax->executePostActionsHook(object(DC_Table))
     (vendor/contao/core-bundle/src/Resources/contao/classes/Ajax.php:509)
  at Contao\Ajax->executePostActions(object(DC_Table))
     (vendor/contao/core-bundle/src/Resources/contao/classes/Backend.php:429)
  at Contao\Backend->getBackendModule('article', null)
     (vendor/contao/core-bundle/src/Resources/contao/controllers/BackendMain.php:168)
  at Contao\BackendMain->run()
     (vendor/contao/core-bundle/src/Controller/BackendController.php:49)
  at Contao\CoreBundle\Controller\BackendController->mainAction()
     (vendor/symfony/http-kernel/HttpKernel.php:152)
  at Symfony\Component\HttpKernel\HttpKernel->handleRaw(object(Request), 1)
     (vendor/symfony/http-kernel/HttpKernel.php:74)
  at Symfony\Component\HttpKernel\HttpKernel->handle(object(Request), 1, true)
     (vendor/symfony/http-kernel/Kernel.php:202)
  at Symfony\Component\HttpKernel\Kernel->handle(object(Request))
     (public/index.php:44)

Version 1.5.13 not installable in contao 4.13

Contao 4.13
Php 8.1
Fresh installation (console)

Error message: Fatal error: Declaration of Terminal42\NodeBundle\Picker\NodePickerProvider::supportsContext(string $context): bool must be compatible with Contao\CoreBundle\Picker\PickerProviderInterface::supportsContext($context) in C:\Laragon\www\wguw-wgu-wismar.de\vendor\terminal42\contao-node\src\Picker\NodePickerProvider.php on line 70

Maybe introduced by 8dc6f83 ?

Add IDs in overview and alias for insert tags

May be it is a good idea in the overview of the nodes to show the IDs of the created nodes, so it might be easier to find the right node? I just placed some examples for the id labeling.

nodes_ids

For an easier handling when inserted in the content it might be a good improvement also to establish an alias for the use in the insert tags?

nodes_alias

TypeError if InsertTag is combined with ID of non-existent Node-Element

If an ID of a non-existent Node-Element is refrenced in an InsertTag, an Server error 500 is produced.

Error message
Return value of Terminal42\NodeBundle\EventListener\InsertTagsListener::generateNodes() must be of the type string, null returned

Versions
Contao: 4.7.7 and 4.9.5
Node: Current Release 1.3.1

Reason
The InsertTagListener function generateNodes is declared to return a string.
It calls generateSinglein Line 68

private function generateNodes(string $ids): string
{
if (0 === \count($ids = StringUtil::trimsplit(',', $ids))) {
return '';
}
// Generate a single node
if (1 === \count($ids)) {
return $this->manager->generateSingle((int) $ids[0]);

The NodeManager function generateSingle is declared as nullable | string. If null is returned, the TypeError occurs.

public function generateSingle(int $id): ?string
{
if (!$id) {
return null;
}
if (null === ($nodeModel = NodeModel::findOneBy(['id=?', 'type=?'], [$id, NodeModel::TYPE_CONTENT]))) {
return null;
}
return $this->generateBuffer($nodeModel);

Solution?
Check in generateNodesif the returned value is a string and else return an empty string.
or
Return an empty string from generateSingleinstead of null.

Screenshot
image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.