I'm getting strange behavior from CASAA.

I have two views one called obituaries and one call classifieds.
the only casaa mapping that shows on the page for the views is the [404] map. the mappings that are in place for them do not register.

while doing a debuging test i put some debugging code in to the casaa module one on each side of the test for 404 while loop.
the results showed that even with a mapping in place that area was coming up with the 404 mapping not the classifieds or obituaries mapping.

I have found the issue. and am confused at how it was working at all.

i made changes around line 223

                while ($test = db_fetch_object($path_query)) {
                        if (strstr(substr($path, 1), str_replace('*', '',str_replace('/*', '', $test->casaa_path)))) {
                                $tmp_path=$path;
                                break;
                        }
                        else if ($path == '/' . $not_found_test && !strstr(substr($path, 1), str_replace('*', '',str_replace('/*', '', $test->casaa_path)))) {
                                //added an extra char at the beginning because of the substr in the query below.
                                $tmp_path = "[[404]";
                        }
                }
                        if($tmp_path !== $path) {
                                $path = $tmp_path;
        }

Comments

cntlscrut’s picture

Assigned: cntlscrut » Unassigned
Status: Fixed » Active

I see what's going on.

The system is only checking the url_alias table for registered paths when it should be including system paths from the menu tables like where views stores it's callbacks.

Good find!

cntlscrut’s picture

Assigned: Unassigned » cntlscrut
cntlscrut’s picture

Status: Active » Needs review

I added an extra check to look for paths that were created by modules i.e. views.

		while ($test = db_fetch_object($path_query)) {
			if (strstr(substr($path, 1), str_replace('/*', '', $test->casaa_path))) {
				break;
			}
			else if ($path == '/' . $not_found_test1 && !strstr(substr($path, 1), str_replace('/*', '', $test->casaa_path))) {
				//check to make sure the path is not a system path such as a views path before we commit to 404-ing it
				$menu_query = db_query("SELECT path FROM {menu_router} WHERE path LIKE '%s'", substr($path, 1));
				$not_found_test2 = db_fetch_object($menu_query);
				if ($path !== '/' . $not_found_test2->path) {
					//added an extra char at the beginning because of the substr in the query below.
					$path = "[[404]";
				}
				break;
			}

change available as of version 6.x-1.14-rc1

cntlscrut’s picture

Status: Needs review » Fixed
cntlscrut’s picture

Assigned: Unassigned » cntlscrut
Status: Active » Fixed

rearranged the code.... preferred what the whytewolf submitted.

cntlscrut’s picture

Status: Fixed » Needs review
cntlscrut’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.