Undefined variable error, but I've changed nothing

So today I’m getting an error on my site, in the homepage only, and it’s saying that I’ve not got a defined variable. Here’s the code:

<?php foreach($page->children()->visible() as $content): ?>
        
        <?php snippet($content->intendedTemplate(), array('data' => $data, 'content' => $content)); ?>
        
    <?php endforeach ?>

What’s also odd is that my user accounts are not working in the panel, either, even if I replace them with known good copies. What have I janked up?

Well, what variable is not defined and in what file and line is the error thrown?

What is $data? Looks as if this is the variable that is not defined?

Yes, the debugger is telling me that data is undefined. But it’s weird because this code has been working since December, and it’s not been changed at all, nor has the homepage had any major updates, but all the sudden it’s telling me it’s not working. It’s very bizarre.

If you want to see the code, it’s live (unfortunately) at http://greatermontana.org

Well, I don’t know why this didn’t throw any error before, but if that is all your code, then I don’t see any $data variable defined. And I don’t know what $data is supposed to do there, either. Do you use the $data variable in the snippets?

As regards the user accounts, what do you mean with they are not working? You can’t log in with any of these user accounts?

Nope. Both user accounts were saying incorrect password, and I have the password’s in a management app. I pulled the archive php files for each and uploaded them, still nothing. Deleted them both and turned panel config on, recreated mine, then added the other back through the panel functions, and have returned that config to false, and the users are back up.

But back to how this was working before and how it’s not working now. This is beyond strange.

Also, no I don’t, so I don’t know why I’m calling it either. Let’s remove it.

removed and that fixed it. so weird. Thanks for the help, i’m dealing with allergies and my head feels like it might explode, so this was far harder than it needed to be.

Well, it seems weird, but maybe you had debug and whoops both set to false in your config, so the error didn’t show up. With debugging on, an undefined variable wouldn’t always thrown an error. Or you did change something after all and just forgot about it, happens ever so often.

Anyway, it’s sorted now, take care of yourself.