Drupal 8.4.0
LDAP 8.x-3.0-beta3
PHP 7.0.22
I'm able to add servers, but unable to edit servers.
Error output when I try to edit a saved server:
Uncaught PHP Exception Symfony\\Component\\Routing\\Exception\\RouteNotFoundException: "Route "entity.ldap_server.canonical" does not exist." at /site/core/lib/Drupal/Core/Routing/RouteProvider.php line 190, referer: http://site.com/admin/config/people/ldap/server
Function found at line 190 at '/site/main/core/lib/Drupal/Core/Routing/RouteProvider.php':
/**
* Find the route using the provided route name (and parameters).
*
* @param string $name
* The route name to fetch
*
* @return \Symfony\Component\Routing\Route
* The found route.
*
* @throws \Symfony\Component\Routing\Exception\RouteNotFoundException
* Thrown if there is no route with that name in this repository.
*/
public function getRouteByName($name) {
$routes = $this->getRoutesByNames([$name]);
if (empty($routes)) {
throw new RouteNotFoundException(sprintf('Route "%s" does not exist.', $name));
}
return reset($routes);
}
Comments
Comment #2
ydahiComment #3
ydahiComment #4
ydahiA few other notes that may lead to a quicker solution.
Route defined in /site/modules/ldap/ldap_servers/ldap_servers.routing.yml:
Commented-out code in /site/modules/ldap/ldap_servers/src/Entity/Server.php:
$server_edit_path defined on line 274 in /site/modules/ldap/ldap_servers/src/ServerFactory.php:
Comment #5
ydahiI was able to hide/fix the problem by deleting line 38 of Server.php which read:
The word 'canonical' is only found in three locations within the module:
The links array in Server.php now looks like this for me:
I'm new to D8/symphony development so if anyone cares to explain why an array within a comment can be called, I'd appreciate it.
Looking forward to a full fix.
Comment #6
ydahiComment #7
grahlHi
Could you please retest with latest dev? This sounds more like a misconfiguration on your end. I don't believe we added any improvements to that form since beta3 and the removal you are attempting above is not something we want to do. See also: https://www.drupal.org/docs/8/api/entity-api/creating-a-content-entity-t...
There could be a syntax change from 8.4.0 which could cause this but I cannot reproduce this locally with 8.4.0, latest dev and PHP 7.1.
Please provide additional information on how to reproduce this.
Comment #8
ydahiHi grahl,
I set up a clean Drupal 8.4.0 instance and tested the ldap (8.x-3.0-beta3) module - everything works fine and I am able to edit server definitions.
After installing each of the modules that were on the inflicted site, I think I've found the issue: https://www.drupal.org/project/cancel_button
Steps to reproduce:
- Drupal 8.4.0
- PHP 7
- LDAP 8.x-3.0-beta3
- Entity Form Cancel Button 8.x-1.0
Enabling the cancel button module produces an error when trying to edit a defined server.
A simple workaround is to disable the cancel button for ldap_server pages, which can be done very simply using the cancel_button module's settings.
Comment #9
grahlThanks for tracking that down.
I'm moving this issue over to cancel_button. If they require a different behavior in ldap_servers and are willing to provide a patch, I'll consider adding it.
Comment #10
norman.lolComment #11
grahlThis was apparently fixed on our end through the patch provided in #2961668: LDAP configuration entity types define a canonical link template but do not have a canonical route. Apparently we declared a canonical route which didn't exist.
Please reopen if this is still broken for you with latest DEV of ldap.