bmlt-enabled / bread

BMLT Meeting List Generator Plugin For Wordpress https://wordpress.org/plugins/bread/
https://wordpress.org/plugins/bread/
GNU General Public License v2.0
6 stars 9 forks source link

Service Body (Additional Section) meetings show 12 AM start time #174

Closed chapmangeo closed 2 years ago

chapmangeo commented 3 years ago

Note the Area Service meeting section vs. the (debug) versions of the meetings on Sunday in the Main section CTANA Meeting Schedule DEBUG 20210920.pdf .

chapmangeo commented 3 years ago

It's in the ASM template. I switched to using "time" in a custom template; it now prints correctly.

chapmangeo commented 3 years ago

The following line @1867 in bmlt_meeting_list.php 2.6.1 triggers the offending behavior. It looks like it might have been moved from the loop at @1888 in 2.6.1 (@1767 in 2.4.4-Beta1). Have not looked further. "$value = $this->enhance_meeting($value, $this->options['asm_language']);"

otrok7 commented 3 years ago

Did a template delivered with Bread contain an invalid code in its "additional meetings" template? If so, what was the invalid code (you say "time" works, but not what didn't work)? Or was this an older configuration, that needed to be adjusted?

chapmangeo commented 3 years ago

In our (ctana.org's) bread config 4 (testing, a copy of our original config 1) we did not specify a default for the ASM meeting format in the second (service area) meeting list section, we let it default to whatever (I could not find the default) bread provides.  It used to work just fine, providing something like this:

Activities Sub-committee Meeting - Last Sunday of the month - 2:30
PM - Austin Galano Club - 6809 Guadalupe St North Central North
Central Austin 78752

On the current distributed bread source (2.6.1), it produces this:

Activities Sub-committee Meeting - Last Sunday of the month - 12:00
AM - Austin Galano Club - 6809 Guadalupe St North Central North
Central Austin 78752

The behavior changed when this line was moved from L1887 to L1867 (2.6.1 line numbers) in 2.4.4-beta1.

$value = $this->enhance_meeting($value, $this->options['asm_language']);

I'm guessing, but once I found the trigger I stopped looking, that there's a not-yet-set-pointer issue that is stepping on the meeting information...

I can fix it by explicitly defining the ASM format in the template, instead of defaulting it as the distribution json did.  But obviously that is covering up a deeper problem that may bite all of us down the road. 

I've attached the working config file, the one with a defaulted template which breaks, and a tweaked (debug) copy of 2.6.1 which works on the default (blank) config since I restored the enhanced_meeting call to it's earlier location (which I assume breaks something else).

On 9/24/21 09:18, otrok7 wrote:

Did a template delivered with Bread contain an invalid code in its "additional meetings" template? If so, what was the invalid code (you say "time" works, but not what didn't work)? Or was this an older configuration, that needed to be adjusted?

bmlt-asm-12AM-files-20210924.tar.gz

otrok7 commented 3 years ago

OK, I see what is going on (and it has nothing to do with unset pointers): when there is no template for the service meetings (additional-list), Bread has one hardcoded into it. And what's more, you can neither see or edit this template. In fact, I forgot it was even there, and somehow thought the regular meeting template was used in this case. But no, there it is, hardcoded in PHP. And with a bug where time should be printed.

You did exactly the right thing by creating your own template. In fact, I would rather like to simply force this solution on users. For backwards compatibility, I will need to give this field a default value. I will however, be displaying the template being used (and making it editable, too).

But I think you found yourself the correct workaround, for now. Thanks for your help and patience!