[URLMAPPER] Fix small bug in URLMapper: a dynamic route might not exist even if a static one does
This commit is contained in:
		@@ -169,8 +169,8 @@ class URLMapper
 | 
				
			|||||||
            throw new Exception(sprintf('No candidate paths for action "%s"', $action));
 | 
					            throw new Exception(sprintf('No candidate paths for action "%s"', $action));
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        if (array_key_exists($action, $this->reverse_dynamics)){
 | 
				
			||||||
            $candidates = $this->reverse_dynamics[$action];
 | 
					            $candidates = $this->reverse_dynamics[$action];
 | 
				
			||||||
 | 
					 | 
				
			||||||
            foreach ($candidates as $candidate) {
 | 
					            foreach ($candidates as $candidate) {
 | 
				
			||||||
                list($tryArgs, $format, $paramNames) = $candidate;
 | 
					                list($tryArgs, $format, $paramNames) = $candidate;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -201,9 +201,10 @@ class URLMapper
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
                return $path;
 | 
					                return $path;
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        if (array_key_exists($action, $this->reverse_statics)) {
 | 
				
			||||||
            $candidates = $this->reverse_statics[$action];
 | 
					            $candidates = $this->reverse_statics[$action];
 | 
				
			||||||
 | 
					 | 
				
			||||||
            foreach ($candidates as $candidate) {
 | 
					            foreach ($candidates as $candidate) {
 | 
				
			||||||
                list($tryArgs, $tryPath) = $candidate;
 | 
					                list($tryArgs, $tryPath) = $candidate;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -224,6 +225,7 @@ class URLMapper
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
                return $path;
 | 
					                return $path;
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        // failure; some reporting twiddles
 | 
					        // failure; some reporting twiddles
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user