Getting tons of these

Notice: Undefined index: q in bootstrap_preprocess_menu_link() (line 1022 of themes\bootstrap\bootstrap.theme).

Patched with simple test for isset($_GET['q']) - but this should be set after rewrites. In any case... here's a 20 char patch!

Files: 
CommentFileSizeAuthor
#2 bootstrap-undefined-idx-q-2049641-2.patch992 bytesergophobe
PASSED: [[SimpleTest]]: [MySQL] 0 pass(es).
[ View ]
bootstrap-8.x-2.x-undefined-idx.patch1.29 KBergophobe
FAILED: [[SimpleTest]]: [MySQL] Setup environment: Test cancelled by admin prior to completion.
[ View ]

Comments

markcarver’s picture

Status:Needs review» Closed (won't fix)

Pretty sure this has to do with your web server. $_GET['q'] should always exist in a Drupal environment. Also your patch inserts {{ dump() }} into page.html.twig

ergophobe’s picture

Status:Closed (won't fix)» Needs review
StatusFileSize
new992 bytes
PASSED: [[SimpleTest]]: [MySQL] 0 pass(es).
[ View ]

Let's try that again without adding debug code to page.html.twig

markcarver’s picture

Status:Needs review» Closed (won't fix)

I have not seen these errors at all.

Pretty sure this has to do with your web server. $_GET['q'] should always exist in a Drupal environment.

markcarver’s picture

I do appreciate you testing the 8.x branch though :) Seriously, I'm a little surprised anyone has other than me.

ergophobe’s picture

Pretty sure this has to do with your web server. $_GET['q'] should always exist in a Drupal environment.

You would think so. That's what I meant by "but this should be set after rewrites" (meaning that once the RewriteRule converts the clean URL to a GET param).

Here's the thing though, I've installed it on two very different servers, totally different machines, totally different environments. One is a WAMP server and the other is a CentOS standard CPanel install. I get the same message on both servers. I also have Ubuntu running on my local machine, but was having some issues getting D8 running.

I'm sure you have way more pressing issues to handle, but I can give you admin and shell access to the CentOS machine if you're ever curious.

I do appreciate you testing the 8.x branch though :) Seriously, I'm a little surprised anyone has other than me.

I appreciate you having anything at all that runs on D8. It's fun just to see where things are at with this and I'm frankly shocked at this early stage that I could pull from git and just run with, relatively speaking, no problems. Great work!

markcarver’s picture

Well I'm becoming more involved with the Twig in core initiative, so I'm working on a lot of that stuff still. I'm kind of waiting for a few issues to land before I really start heavily diving back in to porting this to D8 (there's going to be a LOT of theming api additions/changes over the next month or so).

I think the other reason I closed this is because in reality it should be refactored to utilize #1998638: Replace almost all remaining superglobals ($_GET, $_POST, etc.) with Symfony Request object once it's in. These are the type of things that I'm kind of like.... meh, yeah you may be right, but in reality I haven't really done all that much to utilize all the power behind D8 yet.

Feel free to get on IRC though if you run into any other issues.

ergophobe’s picture

Totally understood. At this early stage I expect that you might close all sorts of things because you have a larger solution in mind.

And I should have checked the distro .htaccess file right away 'cause I would have realized that Drupal 8 doesn't rewrite clean URLs to a GET param anymore. This is the new rewrite from the distro .htaccess

# Pass all requests not referring directly to files in the filesystem to
# index.php. Clean URLs are handled in drupal_environment_initialize().
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !=/favicon.ico
RewriteRule ^ index.php [L]

I got a lot to learn to get up to speed on D8!

markcarver’s picture

Ah, I didn't even know about that change. Yeah, ok so my previous statement of $_GET['q'] "always exists" is now false lol That must have been a recent commit to HEAD though because I don't remember getting those errors at all. I run everything on nginx locally so I stopped looking at .htaccess files a while ago.

So yeah, another reason... things constantly change in HEAD lol One thing that works now might not in like a week..... or a day later lol

ergophobe’s picture

things constantly change in HEAD

Well, July 1 was API freeze, so that limits changes somewhat.

Ah, I didn't even know about that change.

Surprisingly, that goes back to 2010 and this commit
http://drupalcode.org/project/drupal.git/commitdiff/1df3cfffefefc93ed2d2...

The funny thing about that is I just did a
$ less .htaccess

just to make sure it wasn't empty. Watched it scroll by and didn't think anything of it. Then an hour later I was out running and suddenly saw plain as day in my head the RewriteRule with a simple rewrite to index.php and thought I was imagining things and I couldn't possibly be remembering something I hadn't read. But when I got back to my computer the less output was still there and sure enough!

Anyway, not trying to create headaches or makework for you.... just seems like figuring out why things are or are not working is a good way for me to get up to speed on D8.

highermath’s picture

Status:Closed (won't fix)» Needs review
markcarver’s picture

Status:Needs review» Closed (won't fix)

See my comment in #6. fwiw, the entire 8.x branch is now being postponed per #1840980: [meta] Bootstrap 3.0.

This issue will solve itself, eventually.