ZPBootStrap Include Issue

Adrian0832 Member
edited January 7 in Themes

Another question from the department for "I've broken something again". And I don't know if it's ZenPhoto, ZPBootstrap or PHP I've broken...

I've a workaround, but it's not scalable, and I could do without the same issue again...

Issue (or you'll get bored and not read to the end)

PHP include was working but now not including (but no error)...

Background

Two instances of ZenPhoto, same domain, different subdirectories and albums (one is "live" [27,000 images] and one "test" [12 images]). Same version of both ZenPhoto and ZPBootstrap
Each has four themes - Basic, ZPBootstrap and two "modified" ZPBootstrap (two different sites I'm developing, different colours, logo etc)

Both instances working fine until just before Christmas - then the live one went "weird"
It affected all three themes based on ZPBootstrap, but not Basic
it only affected "live", not "test"
Images (and links) were there but formatting, menus were not

Detective Work

Looking in the browser at "Page Source"; Home, Gallery, News and other sections were not including "inc_header.php". This was the only part missing, others (including "inc_footer.php") were fine.
Built some scaffolding around the first line of "Home" - 'about to include inc_header' displayed, 'back from include inc_header' was displayed but inc_header had not been included.
Change 'include' to 'require' (so it would abort if it couldn't) - no change
Add a line to display the status of include - "True" - Home thinks it's been included

Workaround (or desperation!)

Copy 'inc_header' to a new file 'inc_head' and include that in Home - it worked! Repeat for "Gallery", "News", "Favourites" etc

Conclusion

For some reason, one (and only one) instance of ZenPhoto has stopped (it was previously working) including "inc_header.php" but without an error - no other include is affected.
But I'm worried that next week it might stop including "inc_footer" and I've got to do it all again. I'd like to know why

Comments

  • acrylian Administrator, Developer
    edited January 7

    You did neither mention the version of zpBoostrap nor Zenphoto. Note that the original zpBoostrap is not maintained for years. So if use our fork that at least is generally compatible with the current Zenphoto releases: https://github.com/zenphoto/zpBootstrap

    Sounds more like a server side issue. PHP require and include (incl the ones with "_once") are doing generally the same with some detail difference

    Maybe any server update occurred? You surely have consulted the debug logs (ZP's and the server PHP log). What do they tell about this?

  • ZenPhoto 1.6.4
    BootStrap 3.4.1 so thank you (although it was working up to Christmas on "live" and is still working on "test")
    ZP Debug logs contain nothing obviously related, server PHP log likewise.
    I'll have a play with the various PHP functions around "get_include_path" and "resolve_php_path"...

Sign In or Register to comment.