Call to undefined method Illuminate\Html\FormFacade::open() - forms

I am building a web app with Laravel and I get this error once I run the application:
Call to undefined method Illuminate\Html\FormFacade::open()
Some mention to use "laravelcollective/html": "5.1.*" as "illuminate/html": "^5.0" no longer uses Form. However, in both cases I get the error message above. Can you advise me how to solve this problem.

Be sure your composer.json file uses "laravelcollective/html": "^5.0#dev", as the illuminate version is no longer supported.
Be sure to add Collective\Html\HtmlServiceProvider::class, in your config/app.php file as a providor, as well as the aliases:
'HTML' => Collective\Html\HtmlFacade::class,
'Form' => Collective\Html\FormFacade::class,

Related

Adding message to IMAP folder using ZF3

I am trying to add a new message to IMAP folder using Zend Framework 3.
The code I use is the following:
...
$draftMessage = new \Zend\Mail\Storage\Message([
'headers' => [
'subject' => 'voyteck0#gmail.com',
],
'content' => 'ala ma kota',
]);
[valid-imap-connection]->appendMessage($draftMessage, 'Drafts', [\Zend\Mail\Storage::FLAG_DRAFT]);
...
However I always get an exception thrown:
Zend\Mail\Storage\Exception\RuntimeException:'cannot create message, please check if the folder exists and your flags' thrown in /.../zendframework/zend-mail/src/Storage/Imap.php(480)
I have also used in here a pseudo-element [valid-imap-connection] not to blur the problem - but the connection is working fine (retrieves messages, sends them, moves between folders etc.)
The folder exists - I have done some debuging even within ZF already and found out that in that line 480 the command returns NULL on the above code. If I change the folder into non-existing one - it returns false.
The Exception itself is thrown once (! result) - so null is also true for this condition.
However even if I am removing the code that throws exception (And the code completes execution with that NULL value) - still the message is not appearing in the folder (checking directly on the disk). There's nothing interesting in Dovecot logs (apart from the fact the connection is successfully established).
Any ideas highly welcome :)
I think the problem was with 2 things:
I should have used \Zend\Mail\Message class (not the ...\Storage... one)
The draftMessage should be a string version (actually dunno why - since appendMessage already uses toString() function)
So the code that works is following:
...
$draftMessage = new \Zend\Mail\Message();
$draftMessage->setSubject('voyteck0#gmail.com');
$draftMessage->setBody('ala ma kota');
[valid-imap-connection]->appendMessage($draftMessage->toString(), 'Drafts', [\Zend\Mail\Storage::FLAG_DRAFT]);
...

Warning: Illegal string offset 'target' in typo3/sysext/lang/Classes/LanguageService.php

I'm updating a project from 4.5 to 6.2.9
One of my backend module shows this warning in core module. This is the area calls to the language module.
$this->MOD_MENU = Array (
"function" => Array (
"1" => $LANG->getLL("function1"),
"2" => $LANG->getLL("function2"),
"3" => $LANG->getLL("function3"),
Any Ideas?
After two days of research and finding. A small line of mistake I could find in my index.php in my module directory [mod/index.php].
I've included locallang.php file using
require 'locallang.php';
When I replace that with typo3 API function $GLOBALS['LANG']->includeLLFile it has been fixed.
$GLOBALS['LANG']->includeLLFile("EXT:extension_directory/mod1/locallang.php");

Where to add guard config information of zfc-rbac?

I am following this guide to add Zfc-Rbac in my application. But I can't figure out where to put this configuration information.
Application\config\application.config.files
or Application\modules\modulename\config\module.config.php
You can also put it in a global config file, ie application/config/autoload/zfcrbac.global.php
Either in application/module or application/vendor, place the config inside the ModuleName/config/module.config.php
Also make sure you have added the ZfcRbac to the application module list
'modules' => array(
'Application',
'ZfcRbac',
'DoctrineModule',
'DoctrineORMModule'

Symfony 2 form in eZ Publish 5, CSRF intuition

I'm working on a eZ publish 5 project. This CMS is based on symfony 2.
I have built a form without class as described in tge page : http://symfony.com/doc/current/book/forms.html#using-a-form-without-a-class
On the eZ publish 5 documentation (https://confluence.ez.no/display/EZP/Legacy+configuration+injection) I read that I need to set the CSRF intention parameter to 'legacy'. I can't figure how to do this. I tried to use the add method on my formBuilder :
$this->createFormBuilder()->add('_token', 'csrf', array('intention'=>'legacy');
But I get an error 'could not load type csrf'.
Can someone help me on this ?
Thanks.
Okay, I have given this a try.
My first answer is actually a question: If you don't intend to execute any legacy kernel code as a follow-up to your form, you don't need to care about the intention, I believe.
Intentions between the Symfony and legacy kernels only need to match if the Legacy Kernel is booted (in which case it will check if there is a token, and if it is valid).
If you need to use the Legacy Kernel, you can set the intention to legacy by passing custom form options:
$formOptions = array( 'intention' => 'legacy' );
$form = $this->createFormBuilder( null, $formOptions )
->add( 'text', 'text' )
->getForm();
Setting the default intention is explained in http://symfony.com/doc/current/book/forms.html#csrf-protection, but I wouldn't really advise this, unless you intend to only rely on the legacy kernel.

Zend Framework 1.11.12, Doctrine 2.2.2 integration: Error 500

I'm trying to integrate Doctrine 2 into Zend Framework (I'm new to ZF). I've look everywhere on the net but couldn't find my answer...
I've followed this recent tutorial: http://hectorpinol.com/zend-framework-1-11-and-doctrine-2-2-x-integration/ and I've managed to generate a table using the CLI.
The last step of the tuto is to add a new line in this table, simply using the Index controller. But my website doesn't work anymore (a brutal error 500, no message) because I changed the bootstrap.
if I remove the last lines I added to the _initDoctrine() method, it works again (but without Doctrine of course). Here they are:
// set the proxy dir and set some options
$config->setProxyDir(APPLICATION_PATH . '/models/Proxies');
$config->setAutoGenerateProxyClasses(true);
$config->setProxyNamespace('App\Proxies');
// now create the entity manager and use the connection
// settings we defined in our application.ini
$connectionSettings = $this->getOption('doctrine');
$conn = array(
'driver' => $connectionSettings['conn']['driv'],
'user' => $connectionSettings['conn']['user'],
'password' => $connectionSettings['conn']['pass'],
'dbname' => $connectionSettings['conn']['dbname'],
'host' => $connectionSettings['conn']['host']
);
$entityManager = \Doctrine\ORM\EntityManager::create($conn, $config);
// push the entity manager into our registry for later use
$registry = Zend_Registry::getInstance();
$registry->entitymanager = $entityManager;
return $entityManager;
Do you have any idea to unlock the situation? It's frustrating because I know I'm so close to make it work...
UPDATE1: I forgot to mention, in case it helps: I'm using WAMP on Windows. Thanks
UPDATE2: Added the parameters of the create() function.
UPDATE3: Actually it might not be an error 500. Chrome says this but Firefox just displays nothing. No answer from the server.
1) Change the environment to development to see the error message.
2) Use Bisna library instead, will save a lot of time (I don't see a point in integrating Doctrine manually well only educational purposes but you might want to save it for later).