323 questions
0
votes
0
answers
60
views
mongoimport error inserting documents: unknown operator: $id
I need to fix an old system that has an API built in Symfony and has packages mananged with composer. Basically it has an export routine and an import routine that was working and doesn't work anymore....
1
vote
1
answer
116
views
Symfony (3.2.6) SQL Error | ([Semantical Error] line 0, col 39 near 'parking_ticket_settings': Error: Class 'parking_ticket_settings' is not defined.)
I have problem with SQL query in Symfony (3.2.6).
I am trying to run this code:
$em->persist($AxfonePushPayment);
$query = $em->createQuery("SELECT parking_ticket_settings.id FROM ...
0
votes
1
answer
359
views
Conditionally enable form type in Symfony 2/3
I have 2 form type that display 2 selects
$builder
->add('control1', EntityType::class, [
'label' => 'Country',
'class' => Country::class,
])
...
0
votes
1
answer
450
views
Symfony page not found (Symfony 3)
I am new in Symfony and i am working on existing project. I have created crud with doctrine:generate:crud, but application returns me 404 page not found. I was debugging it with debug:router and ...
-1
votes
1
answer
2k
views
Symfony 3.2, authentification and cross-site cookies
I know that Symfony 3.2 is not maintained for very long time, but it happens that my company use it.
And now we have a problem with authentifacation. We have widget that can be (and is) installed on ...
0
votes
1
answer
695
views
How to convert string from input type="datetime-local" to datetime in symfony without FormBundle?
I have date with time string: array(2) { ["available_from"]=> string(16) "2020-07-30T12:26" ["available_to"]=> string(16) "2020-07-30T23:32" }
Input:
<...
0
votes
0
answers
256
views
How is it possible for the repository parameter to be null?
I'm trying to enhance an old project built with symfony 3.2 but i'm facing a weird issue.
I'm just trying to get some data in my controller to send it to the view. But, for some reason i can't reach ...
0
votes
0
answers
50
views
Symfony 3.2 CollectionType
Here's my problem. In my project, I have a one-to-many relationship between class FactureAchat and LigneFactureAchat, when I add a Facture the products are added in the Table ligne_facture_achat ...
0
votes
1
answer
908
views
Class "Symfony\Bundle\FrameworkBundle\Controller\Controller" not found while loading "App\Controller\StudentController"
Hi I'm fresher for symfony . when i execute the below code it will show error.i installed all the assets of symfony.help me to clear this..!
<?php
namespace App\Controller;
use Symfony\Component\...
1
vote
1
answer
2k
views
Symfony catch PHP errors in CLI command
I have a Symfony 3.2 app. I created a command to run some background task. I have to know when the command finished even if it resulted in an exception or fatal error.
My first idea was to surround ...
0
votes
2
answers
650
views
Symfony 3.2 Form best way to add a filter on textfield to remove unwanted Characters
I am using Symfony 3.2. I have a text field on a Symfony form. I would like to apply a "sanitize" function on form submission. What is the best way to do this? Here is a snippet of the form. The filed ...
0
votes
0
answers
248
views
Display multiple chart in the same page
I'im using symfony 3.2 and ObHighchartsBundle , I'd like to know how to display many charts in the same page.
Right now I'm able to display only one chart called "statMontant".
I'd like to display the ...
0
votes
0
answers
72
views
Symfony website got broken once pushed in production
I'm developing a website using Symfony 3.2, and it worked perfectly well on my machine. It also worked perfectly well when I pushed it on our pre-production server. But then when I pushed it on our ...
0
votes
2
answers
606
views
Can't add a field to a model in Symfony, bin/console crashes
I'm working with Sylius framework. I'm following the guide to customize models.
I am trying to add a field notice to a model Taxon which is already overridden in my project. For that, I added the ...
0
votes
1
answer
5k
views
Symfony3.2 to symfony4 security.encoder_factory deprecated error
I updated my website from Symfony 3.2 to Symfony 4, by creating a new symfony4 skeleton and moved the source code from symfony3.2 to symfony4.
I had been made the changes as mentioned in Upgrading ...
1
vote
1
answer
990
views
How to override errors templates for Symfony
I want to override the error templates in Symfony 3. I've started by creating a TwigBundle folder withe the personalised twig.
app/
└─ Resources/
└─ TwigBundle/
└─ Exception/
├─ ...
0
votes
0
answers
115
views
Symfony - Personnal Recursive function where required = true return false
I came here to relate a problem, i do a recursive function to generate some option for a product.
The problem is when i set required to true, it's already false.
I tryed to force it at true but ...
0
votes
1
answer
84
views
Rendering single data from an array
{{dump(states)}} this returns
FormView {#5921 ▼
+vars: array:33 [▼
"value" => []
"attr" => []
"form" => FormView {#5921}
"id" => "States"
"name" => "States"
"...
0
votes
1
answer
419
views
How to disable required field in symfony form?
I have an address form type that required zipcode. here's the codes
class AddressType extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options)
{
...
1
vote
2
answers
688
views
Symfony 3.2 - HTTP 204 when echoing file_get_contents() for an image created with imagejpeg()
I created an image using the imagejpeg() function within my entity class
$imageSize = $this->_getDefaultImageSize();
$image = imagecreate($imageSize['width'], $imageSize['height']);
...
1
vote
4
answers
583
views
Getting date from a string without time in php
I have to convert a string input to date "1990/07/22" to 22/07/1990 as date,My function is as follows as:
public function($date){
$date_format_sec = strtotime($date);
$date_of_birth = new \...
0
votes
1
answer
158
views
Providing readonly value in twig file returns null in symfony3.2 [closed]
In my application form updation twig is as follows:
<div class="form-group">
{{form_label(formUser.name)}} :
<input class="form-control" disabled="disabled" value="{{formUser.name....
0
votes
0
answers
599
views
Doctrine One-To-One, Self-referencing not working
I am working on a legacy application and I now need to change an existing table (called categories) so that it has a parent_id field which is a foreign key to the primary key of it’s own table (the ...
0
votes
2
answers
1k
views
Doctrine Entity Manager gets Read Only error from database
public function save($itemId, $invoiceName)
{
$query = "
INSERT INTO invoice (item_id, invoice_name)
VALUES (" . $itemId . ",'" . $invoiceName . ")
";
$connection = $...
2
votes
1
answer
6k
views
Script Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache handling the symfony-scripts event terminated with an exception
Heroku Log :
> Incenteev\ParameterHandler\ScriptHandler::buildParameters
Creating the "app/config/parameters.yml" file
> Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::...
2
votes
0
answers
3k
views
Upgrading Symfony project from 3.2 to 3.4
I am trying to upgrade Symfony on Windows 10 machine. Current version is 3.2. I've updated the composer.json package to "symfony/symfony": "3.4.*". Then I ran composer update symfony/symfony and got ...
2
votes
1
answer
266
views
php gearman worker function no synchronized with doctrine
I observed a strange behavior of my doctrine object. In my symfony project I'm using ORM with doctrine to save my data in a mysql database. This is working normal in the most situations. I'm also ...
0
votes
2
answers
6k
views
Symfony3 : "Attempted to load class "ZipArchive" from the global namespace. Did you forget a "use" statement for "PHPExcel_Shared_ZipArchive"?"
I'm using symfony3 and trying to install/use TwigExcelBundle on my ubuntu16 server for an excel exporting purpose.
I can install it by when I try to use I get the following error :
"Attempted to ...
4
votes
1
answer
2k
views
Sonata Admin Advance Filter Customization in DataGridFilter
I am using sonata admin for my project as backend.
I have a module and where i have status in the filter like below :
$datagridMapper->add('status', '', array('label' => 'Status','field_type' ...
1
vote
1
answer
137
views
Non-mapped field is valid whilst it is required and empty
I have a field which is non-mapped and required.
$builder->add('termsAndConditions', CheckboxType::class, [
'required' => true,
'mapped' => false,
'attr' => [
'class' =...
0
votes
1
answer
71
views
Symfony 3.2 forms: IDs and entity values are mixed up after handle request
This is an excerpt from my POST data:
...
lead[contacts][6][firstName]: test
lead[contacts][6][id]: 543961
lead[contacts][6][lastName]: test
...
lead[contacts][7][firstName]: John
lead[contacts][7][...
0
votes
1
answer
512
views
Symfony 3.2 Form Field - Disabling the ID
Is it possible to render an input field without id?
I would like to disable it in the twig file.
I want that because I have a error "non-unique id" in the chrome console.
I have conducted research ...
0
votes
2
answers
1k
views
Symfony 3 : how to reordering an array collection with route action?
I have a Product Entity. Each product can have 0 or N pictures.
I have a ProductPhoto Entity which has a order property (0 = first).
On a page, I list all the pictures of my current product. I would ...
-1
votes
1
answer
39
views
FOSUserBundle error after installation - Symfony 3.2
I recently created a new project in Symfony 3.2 and installed via composer following https://symfony.com/doc/master/bundles/FOSUserBundle/index.html the bundle FOSUserBundle.
(information : I used ORM)...
0
votes
2
answers
219
views
Persisting Collection of Forms in a ManyToOne/OneToMany association
I have read and re-read everywhere I could, and I am unable to find the proper answer to my problem. Here is the problem. I have 2 entities. Equipment, EquipmentPart respectively.
Equipment:
/**
* @...
1
vote
1
answer
2k
views
Doctrine findBy boolean field returns no results
Recently, a piece of code stopped working. I haven't made any changes to it so I don't know why.
Here's the code:
$invites = $this->vault_em->getRepository('AppBundle:Invite\LocalInvite')->...
0
votes
1
answer
54
views
Symfony 3.2 Form events : Can't retrieve data
I didn't find any subject related to my question and my case is very particular that's why i am calling for help.
I have 4 involved entities : PurchaseOrder, SapPO, project and Product. As shown ...
-1
votes
1
answer
1k
views
Symfony: Generate documentation from markdown with Table of contents
What are the best practices for generating a documentation (of a tool/service) in Symfony?
To be a little more explicit:
I want to use Markdown to write a documentation
I will probably have more ...
3
votes
1
answer
811
views
Symfony CollectionType: Merge new entries
My symfony form represents an entity Mail which has a one to many relation with another entity called Attachment. Therefore, the MailType form contains a CollectionType field for embedding its ...
2
votes
1
answer
551
views
Access to entity manager in config.php
In app/config/config.php we can:
$container->loadFromExtension('doctrine', array(
'dbal' => array(
'driver' => 'pdo_mysql',
'host' => '%database_host%',
'...
0
votes
0
answers
193
views
Symfony doctrine: ManyToOne heritage doesn't work
I am new to Symfony. I'm working on an application where I need a cascading heritage in Doctrine, but heritage doen't appear to work :
I have a mother class, "Content" :
/**
* Content
*
* @ORM\...
-2
votes
1
answer
370
views
How to deploy Symfony3 Application on CentOS
I still cannot understand what happening in my server
when i push my code throught the server in /public_html and wanna get the homepage of my application like this:
http:/www.example.com/web/
...
2
votes
1
answer
193
views
FOSUser The file was found but the class was not in it, the class name or namespace probably has a typo
My entity is :
<?php
namespace MainBundle\Entity;
use FOS\UserBundle\Model\User as lat_users;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Table(name="lat_users")
* @ORM\Entity
*/
class User ...
1
vote
1
answer
3k
views
CORS issue on accessing API with JWT token
I am facing a CORS issue when accessing Symfony REST API from angular with JWT token.
IIS server has been configured to access the application with domain name and IP address. The Front end code is ...
-1
votes
2
answers
2k
views
Restrict Login for All pages for not logged in User: Symfony3
I am using fos bundle for Symfony and it's working fine but now I want to restrict all pages for not logged user except (login and register). How can I achieve that?
1
vote
1
answer
3k
views
How to display result in success ajax to twig file
I'm new in Symfony! I use symfony 3. I have a search input when i type in search i want display the result in the twig file. I got the correct result send from ajax and i have a problem with display ...
15
votes
1
answer
15k
views
test command symfony with phpunit
I create some basic command with symfony3.2 to generate some newsletter periodically
I'm dealing with some issue when i want to test my symfony command with phpunit 5.5.4.
It fail from the beginning:
...
0
votes
1
answer
188
views
Error parsing yml configuration for fos_rest bundle in Symfony 3
i am configuring the fosrest bundle in symfony 3. But i'm gettin this error:
While scanning a flow node we had this expected the node content, but found org.jvyamlb.tokens.PositionedKeyToken
My ...
0
votes
2
answers
49
views
How to chek if the gallery name exist in DB?
public function createGalleryAction(Request $request) {
$gallery = new Gallery;
$gallery_form = $this->createFormBuilder($gallery)
->add('galleryName', TextType::class, ...
1
vote
0
answers
849
views
JMS Serializer Error: Call to a member function getUser() on null
I want to serialize a object in Symfony 3. So I wrote this code:
$serializer = $this->getContainer()->get('jms_serializer');
$context = SerializationContext::create()->enableMaxDepthChecks()-...