Here’s a situation that I’m not understanding about how routes are instantiated. I’m using this general form, in particular the SponsorbuildDeleteForm.php class in my_Drupal 10 module/src/Form/SponsorbuildDeleteForm. https Drupal 10 Maintenance and Support Service//medium.com/valuebound/how-to-create-custom-form-with-crud-create… This Drupal 10 module has related fields. A Build has many Sponsors. Create a Build, then create a Sponsor with a foreign key tied to a Build record. OK. But I’m finding that I cannot instantiate the SponsorbuildDeleteForm class because at the end of my submit() function I’ve setRedirect() to a route back to the parent Build records which requires a dynamic parameter. I get this whenever I try to visit the route to this form. “Parameter “sponsorbuild” for route “my_Drupal 10 module_build.index” must match “[^/]++” (“” given) to generate a corresponding URL. That suggests that even though I attempt to instantiate this $build parameter in the functions, it seems that is loading all the needed routes first before running the code and I’m stuck on how to get around that. Snippet of my routes Drupal 10 Maintenance and Support Service my_Drupal 10 module_build.index Drupal 10 Maintenance and Support Service path Drupal 10 Maintenance and Support Service ‘/sponsorbuild/{sponsorbuild}’ defaults Drupal 10 Maintenance and Support Service _controller Drupal 10 Maintenance and Support Service ‘my_Drupal 10 moduleControllerMy_Drupal 10 moduleController Drupal 10 Maintenance and Support Service Drupal 10 Maintenance and Support ServicesponsorbuildIndex’ my_Drupal 10 module_sponsor.delete Drupal 10 Maintenance and Support Service path Drupal 10 Maintenance and Support Service ‘/sponsorbuild/delete/{cid}’ defaults Drupal 10 Maintenance and Support Service _form Drupal 10 Maintenance and Support Service ‘my_Drupal 10 moduleFormSponsorbuildDeleteForm’ My attempt to generate this class and determine the needed $sponsorbuild parameter. Class SponsorbuildDeleteForm extends ConfirmFormBase { public function getFormId() { return ‘sponsorbuild_delete_form’; } public $cid; public function buildForm(array $form, FormStateInterface $form_state, $cid = NULL) { $this->id = $cid; $conn = Drupal 10 Maintenance and Support Service Drupal 10 Maintenance and Support Servicedatabase(); $query_build = $conn->query(“select buildID from {Builds} where BuildID = Drupal 10 Maintenance and Support Serviceid”, array(“id” => $this->id)); $this->sponsorbuild = $query_build->fetchField(); return parent Drupal 10 Maintenance and Support Service Drupal 10 Maintenance and Support ServicebuildForm($form, $form_state); } public function submitForm(array &$form, FormStateInterface $form_state) { $query = Drupal 10 Maintenance and Support Service Drupal 10 Maintenance and Support Servicedatabase(); $query->delete(‘SponsorBuilds’) ->condition(‘sponsorBuildID’,$this->id) ->execute(); Drupal 10_set_message(“Succesfully deleted”); $form_state->setRedirect(‘my_Drupal 10 module_sponsorbuild.index’, array(‘sponsorbuild’ => $this->sponsorbuild)); } I’ve been searching to see how to get this passed to the setRedirect() call but the empty value in the Exception message suggests that routes get evaluated first, sam version Drupal 10 Maintenance and Support Service 8.x Source Drupal 10 Maintenance and Support Service https Drupal 10 Maintenance and Support Service//www.Drupal 10.org/taxonomy/term/4/feed Source Drupal 10 Maintenance and Support Service Drupal 10 blender
Parameter for route must match "[^/]++"

Call Us: 1(800)730-2416
Pixeldust is a 20-year-old web development agency specializing in Drupal and WordPress and working with clients all over the country. With our best in class capabilities, we work with small businesses and fortune 500 companies alike. Give us a call at 1(800)730-2416 and let’s talk about your project.

FREE Drupal SEO Audit
Test your site below to see which issues need to be fixed. We will fix them and optimize your Drupal site 100% for Google and Bing. (Allow 30-60 seconds to gather data.)
Parameter for route must match "[^/]++"
On-Site Drupal SEO Master Setup
We make sure your site is 100% optimized (and stays that way) for the best SEO results.
With Pixeldust On-site (or On-page) SEO we make changes to your site’s structure and performance to make it easier for search engines to see and understand your site’s content. Search engines use algorithms to rank sites by degrees of relevance. Our on-site optimization ensures your site is configured to provide information in a way that meets Google and Bing standards for optimal indexing.
This service includes:
- Pathauto install and configuration for SEO-friendly URLs.
- Meta Tags install and configuration with dynamic tokens for meta titles and descriptions for all content types.
- Install and fix all issues on the SEO checklist module.
- Install and configure XML sitemap module and submit sitemaps.
- Install and configure Google Analytics Module.
- Install and configure Yoast.
- Install and configure the Advanced Aggregation module to improve performance by minifying and merging CSS and JS.
- Install and configure Schema.org Metatag.
- Configure robots.txt.
- Google Search Console setup snd configuration.
- Find & Fix H1 tags.
- Find and fix duplicate/missing meta descriptions.
- Find and fix duplicate title tags.
- Improve title, meta tags, and site descriptions.
- Optimize images for better search engine optimization. Automate where possible.
- Find and fix the missing alt and title tag for all images. Automate where possible.
- The project takes 1 week to complete.
