Skip to main content

Posts

It is not a valid class. Check the name

I set up a response form to comments posted on my music and texts that I publish to know they are suitable. My comments are posted well and I manage to retrieve the id of the comment posted to which I want to respond (via js) but when I want to save my response in my table, I get this error: The "App\Entity\Comment" entity has a repositoryClass set to "App\Entity\CommentRepository", but this is not a valid class. Check your class naming. If this is meant to be a service id, make sure this service exists and is tagged with "doctrine.repository_service". My Home controller (here are the articles and comments): // PARTIE COMMENTAIRES // On crée le formulaire vierge (on instancie) $comment = new Comment; // On génère le formulaire $commentForm = $this->createForm(CommentType::class, $comment); $commentForm->handleRequest($request); // Traitement du formulaire if($commentForm->isSubmitted() && $commentForm->isValid()){ $com

How to mount socket.io to fastapi app and send broadcast to all connected clients

I tried to create fastapi application that uses websockets and could broadcast messages to all connected clients. I found out that it's not possible with websockets but found briliant library - socket.io . However I am not sure how could I use it and integrate it with my existing fastapi app. source https://stackoverflow.com/questions/70429135/how-to-mount-socket-io-to-fastapi-app-and-send-broadcast-to-all-connected-client

THREE.JS : display image on objects issue

I am currently creating a webpage in three.js and I struggle to display an image on an object. What I want to do is to display an image on a Mesh with PlaneGeometry. I first tried to load my image as a texture to replace the material of my mesh but it failed it doesn't display anything (even the object disappeared). To create and display my object I used these lines of code (scene is my scene and onglets is the group in which I gathered several objects (onglet1, onglet2, ...)): couleur = new THREE.MeshBasicMaterial( {color: 0x031f3c , side: THREE.DoubleSide } ); plan = new THREE.PlaneGeometry( 0.75 , 0.4 ); var onglets = new THREE.Group(); onglet1 = new THREE.Mesh( plan , couleur ); onglet1.position.set( 0, 0, r ); onglets.add(onglet1); scene.add(onglets); To load my image I modified my code like this: couleur = new THREE.MeshBasicMaterial( {color: 0x031f3c , side: THREE.DoubleSide } ); plan = new THREE.PlaneGeometry( 0.75 , 0.4 ); var

PHP code not connecting HTML to MYsql database [closed]

I'm new to PHP ...... so I want to make a program in which my HTML form inputs are stored in the database. I followed a youtube tutorial to do this this and here is the code I have written for the php file `<?php $firstname = $_POST ['firstname'] ; $email = $_POST ['email']; $admin = $_POST ['admin']; $school = $_POST ['school']; $gender = $_POST ['gender'] ; //DATABASE CONECTION $conn = new mysqli('localhost', 'root', '', 'register'); if ($conn-> connect_error){ die ('connection error : ' . $conn-> connect_error); }else{ $stmt = $conn->prepare("INSERT INTO register(firstname, email, admin, gender) values(?, ?, ?, ?, ?)"); $stmt-> bind_param("ssiss", $firstname, $email, $admin, $gender); $stmt-> execute(); echo"Registration succesfull"; $stmt-> close(); $conn-> close(); }` and here is my database and my html code <html> <head>

Python module not found after pip install [closed]

I just installed python 3.10.0 and installed a package but I keep getting the feedback ModuleNotFoundError: No module named 'BeautifulSoup' every time I try importing it. It appears on my list of installed packages when I run the pip install command. can someone please help source https://stackoverflow.com/questions/70480635/python-module-not-found-after-pip-install

Nodemailer : Can't create new access token for user

const nodeMailer = require("nodemailer"); const sendEmail = async (options) => { const transporter = nodeMailer.createTransport({ host: process.env.SMTP_HOST, port: process.env.SMTP_PORT, secure: true, service: process.env.SMTP_SERVICE, auth: { type: 'OAuth2', user: process.env.SMTP_MAIL, pass: process.env.SMTP_PASSWORD, }, }); const mailOptions = { from: process.env.SMPT_MAIL, to: options.email, subject: options.subject, text: options.message, }; await transporter.sendMail(mailOptions,function(err,info){ if(err){ console.log(err) } else { console.log('success') } }); }; module.exports = sendEmail; when i process this it says "Can't create new access token for user" can anyone help reg this? in env files host is "smtp.gmail.com" and port no is 465 , smtp_service is gmail. i have read some docs regarding gmail api where y

check if array it´s empty javascript

I´m traying to create function to validate my form with jquery by response ajax and laravel backend. in my backend i have this: /** * SEARCH DATA CLIENT FOR CREATE PRECONTRATO */ public function searchClient(Request $request) { $client = $request->get('documento'); $clientSearch = Cliente::where('CIF_NIF', $client)->get(); if($clientSearch->count() > 0){ return $clientSearch[0]; } return $clientSearch; } this function return client or empty collection if query don´t return any result. My problem it´s that i can´t check this condition. If i put one data that in my database don´t exists, return this: [] No properties it´s ok don´t exists, but i have that in my success function ajax and this it´s wrong I have this in ajax: $.ajax({ url: "", method: "POST", data: { "tipo_documento": tipoDocumento, "documento": document