Fluidpage: Error when extending an extbase model - php

I was trying to extend tx_news with some extra fields and was getting an error so I installed this extension to see if that worked: https://github.com/cyberhouse/t3ext-newsauthor
I get the same error on the news pages with my extension and the reference extension:
Sorry, the requested view was not found.
The technical reason is: No template was found. View could not be
resolved for action "error" in class
"Tx_Fluidpages_Controller_PageController".
and the following errors in the be log:
Core: Error handler (FE): PHP Warning: file_get_contents(): Filename
cannot be empty in
/var/www/ukcg6/typo3_src-6.1.7/typo3/sysext/fluid/Classes/View/TemplateView.php
line 187
I am using Typo3 6.1 with:
Fluidpages 2.1.0
Fluidcontent 3.1.0
Flux 6.0.3
VHS 1.8.5

I don't have time to setup your stack here now, but I'll try to help with some general advice on how to trace and locate such kinds of errors.
Basically you will need to trace the error back from the TemplateView.php line 187.
Starting there you look for the variable which is the filename. You can var_dump() that variable and it will probably be "null".
Then you follow that variable back to its origin in backwards order. That means each time this variable gets passed you search for the place in the source code where the function which gets it as a parameter is called.
Doing this you'll definitely find the point where something goes wrong. The filename variable is not properly set and that means one of the previously called functions which should set it screwed up.

Related

Method (...)__toString() must not throw an exception, caught Error: Call to a member function getOptionArray() on null

I receive an error when going in backend Catalog->Categories:
Fatal error: Method
Magento\Ui\TemplateEngine\Xhtml\Result::__toString() must not throw an
exception, caught Error: Call to a member function getOptionArray() on
null in
/home/hubert09/domains/domadeco.com/public_html/vendor/magento/module-ui/Component/Wrapper/UiComponent.php
on line 0
I found it after upgrade Magento from 2.2.0-rc to 2.2.5
thanks to magento profiler i found the problem is in:
/vendor/magento/module-catalog/view/adminhtml/templates/catalog/category/edit/assign_products.phtml
$block->getGridHtml();
that line generate problems
=======SOLVED=========
problem caused by 3th part module Oneleek_DraggableProducts. On 2.2.5 it doesnt work. Turn off that module solve the problem.
IF You migrated M1 to M2 then you are facing something below error during cmd execution The store that was requested wasn't found. Verify the store and try again.
please
don't change in vendor
module-store files :
/vendor/magento/module-store/Model/StoreManager.php or
/vendor/magento/module-store/Model/StoreRepository.php
just simply apply below steps:
I just recently came across this same situation after migrating from Magento 1.9.3.8 to 2.3.0 and hope my answer can be of assistance. The problem came from deleting multiple stores 96 of them to be exact. I tried all the other answers here but was still getting the same error.
The fix for me was removing the old store data from inside of the "core_config_data". The problem is that when the Magento is loading the run time configuration data it is finding the old stores and trying to resolve them. Before cleaning the data from the database I HIGHLY recommend you run the SELECT query below to make sure you delete the correct stores.
SELECT * FROM core_config_data WHERE scope = 'stores';
WARNING: MAKE SURE TO BACKUP YOUR DATABASE BEFORE RUNNING THIS!
DELETE FROM core_config_data WHERE scope_id != 1 AND scope = 'stores';
Now execute all magento commands you can see the "The store that was requested wasn't found. Verify the store and try again" fixed by query
Fatal error: Method
Magento\Ui\TemplateEngine\Xhtml\Result::__toString() must not throw an
exception in
C:\wamp64\www\mage2\vendor\magento\module-ui\Component\Wrapper\UiComponent.php
on line 0
Now check your admin above fatal error also solved blahhh... blahh...
(Note fatal error_Magento\Ui\TemplateEngine\Xhtml\Result::__toString()
depedent store module so don't change module-store vendor otherwise
admin side grid/list catalog you can'not see proper data)

'Twig_Error_Syntax' with message 'Unknown "render" filter

I'm running drupal 8, composer and npm to perform gulp tasks.
When I run npm start.. my task manager: I get the following stack trace:
Fatal error: Uncaught exception 'Twig_Error_Syntax' with message 'Unknown "render" filter.' in /web/project/web/themes/emulsify/components/_patterns/04-templates/basic-page/_basic_page.twig:26
Stack trace:
#0 /web/project/web/themes/emulsify/pattern-lab/vendor/twig/twig/lib/Twig/ExpressionParser.php(481): Twig_ExpressionParser->getFilterNodeClass('render', 26)
#1 /web/project/web/themes/project_theme/pattern-lab/vendor/twig/twig/lib/Twig/ExpressionParser.php(466): Twig_ExpressionParser->parseFilterExpressionRaw(Object(Twig_Node_Expression_Name))
#2 /web/project/web/themes/project_theme/pattern-lab/vendor/twig/twig/lib/Twig/ExpressionParser.php(320): Twig_ExpressionParser->parseFilterExpression(Object(Twig_Node_Expression_Name))
#3 /web/project/web/themes/project_theme/pattern-lab/vendor/twig/twig/lib/Twig/ExpressionParser.php(212): Twig_ExpressionParser->parsePostfixExpression(Object(Twig_Node_Expression_Name))
#4 /web/project in /web/project/web/themes/project_theme/components/_patterns/04-templates/basic-page/_basic_page.twig on line 26
I've looked at installing twig-bridge / symfony twig via composer but I can't seem to get rid of the error message.
Do I just ditch using the twig filter "render"?
Update: 14/08/17
I've also ran into the same problem when trying to use the drupal_block function provided via Drupal 8's twig_tweak module.
The problem in the code above is that your Twig extension class is extending the internal Drupal Twig extension class. That breaks the Twig extensions added by Drupal core and that's why you are getting the error.
To fix this, you should make your Twig extensions extend Twigs internal Twig extension class. Your class should be defined like this:
class MyExtension extends \Twig_Extension {
After making that change, you can also remove arguments set for that class from the MODULE.services.yml
link
I've not seen this in the Drupal context, but working with other platforms that use Twig, I have seen similar issues occurring when an error occurs early in the platform setup process.
The typical sequence of events is like this:
The platform starts running its bootup; loading the CMS core, etc.
At some point early in this process, it hits an error.
It then tries to render an error page.
However, the error page uses a Twig template.
The startup process has not yet loaded all the twig extensions used in the template.
Boom, you get a twig error stating "unknown Twig function" instead of the real error message.
When I've had this before, it has proved very hard to diagnose what the actual error is.
The "correct" solution has been to modify the error page templates so that they are minimal and don't use any non-core twig functions. But if you're getting a crash early in the page load process it can be hard to actually do that.
In the first case, I resolved it by debugging the system and trapping what data was passed to the template. This showed me what the real error was. Resolving that error then stopped the twig error from occurring and allowed me to get into the system.
I don't know for sure if what you're seeing is the same kind of thing as what I was seeing, but it sounds similar so I hope this will help.

Drupal 8: You have requested a non-existent service "router.route_provider.old"

I am creating two custom content type with reference to these pages:
https://www.drupal.org/node/2629550
https://www.drupal.org/node/2693979
Uncaught PHP Exception
Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException:
"You have requested a non-existent service
"router.route_provider.old". Did you mean one of these:
"router.route_provider", "router.route_preloader"?" at
...\core\lib\Drupal\Component\DependencyInjection\Container.php
line 157
Could anyone please help me, why this is happening and how to fix it ?
I am using Drupal 8.1.8 version.
I checked in core.services.yml file, there is no route declared as "router.route_provider.old"
I have created a router names as "router.route_provider.old" by copying "router.route_provider" in the core.services.yml file, which solves my problem.
i think Drupal uses "router.route_provider.old" router as a temporary to copy "router.route_provider" router info. But as this router name is not exists, its throwing exception.
I don't know if this is a bug or there is better way to fix it.
Update:
A patch is provided here: https://www.drupal.org/node/2788087

Undefined method Jackalope\Query\QueryResult::count() when accessing Sylius's 'Blocks' or 'Pages' section on backend

When I click on the 'Blocks' or 'Pages' section in the sidebar in Sylius's admin backend, I get the following error:
FatalErrorException: Error: Call to undefined method Jackalope\Query\QueryResult::count() in /Users/sabrinaliao/Sites/Symfony2/Development/SmartSpine/vendor/pagerfanta/pagerfanta/src/Pagerfanta/Adapter/DoctrineODMPhpcrAdapter.php line 51
I made sure my composer.json matched Sylius's (link). The only difference is that I also added requirements for a few sensio bundles I needed (namely the framework-extra-bundle and the generator-bundle). I looked at the most recent files for jackalope's QueryResult and Pagerfanta's DoctrineODMPhpcrAdapter to ensure that my files were up-to-date. Just to be sure, I manually removed all files in my vendor directory and reran composer.phar update. The error persisted. I looked at Sylius-Standard's composer.json and tried changing my jackalope version to the one shown there, but that just gave me the error about requesting an uninstallable set of packages. I don't know if this is a Sylius problem or a Jackalope problem or a Pagerfanta problem. Would anyone be able to help?
This is a problem with Pagerfanta's DoctrineODMPhpcrAdapter.php. The discussion is going on here: https://github.com/whiteoctober/Pagerfanta/pull/134/files#diff-2

Fatal error: Call to undefined function: MDB2_Driver_MYSQL::getAll()

I am upgrading a site from Fedora 14, PHP4, and PEAR DB to Fedora 16, PHP 5.4 and PEAR MDB2 2.5.0b3, and I am getting the error
Fatal error: Call to undefined function: MDB2_Driver_MYSQL::getAll(). in /usr/share/php/MDB2.php on line 1892
Obviously, I've checked line 1892 of the MDB2.php file, and it contains the error reporting code for the __call magic method (allows you to call a specific function by passing it into __call)
I have checked for usages of __call, and there don't seem to be any. Likewise, when I try to find where MDB2_Driver_MYSQL is coming from, the only place it is even mentioned is in MDB2.php (as a comment about the driver for MySQL), in the class declaration (class MDB2_Driver_mysql extends MDB2_Driver_Common), and the description title in the .xml file.
I have manually included the /usr/share/php/MDB2/Extended.php file in the file where the MDB2_Driver_mysql class is defined, and that didn't help (not that this would have been a permanant fix...)
Has anyone encountered this error, and if so, what did you do to fix it? Google has proved nearly useless, as the only place it is specifically mentioned doesn't really deal with fixing it.
change getAll() in your class, to queryAll(), cause there some difference between DB & MDB2, and the same with getOne, getRow - they all changed to queryOne, queryRow. Here you can read about it http://www.phpied.com/db-2-mdb2/
Make sure you load the extended module in your code prior to making a query, similar to below:
$db->loadModule('Extended');

Categories