Web based family history software

Question [SOLVED] Example module code

  • vytux
  • Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
5 years 1 week ago #1 by vytux
Example module code was created by vytux
I am fairly sure that this code is just there to show what can be done and is not actually required for a custom module for any reason. As it seems to break my module unless a super admin is using it....

Code:
/** * Boostrap. * * @param UserInterface $user A user (or visitor) object. * @param Tree|null $tree Note that $tree can be null (if all trees are private). */ public function boot(UserInterface $user, ?Tree $tree): void { // The boot() function is called after the framework has been booted. // We can now use the current user, tree, etc. if (!Auth::isAdmin($user) && $tree !== null) { return; }

Am I correct with this assumption?

Vytautas

webtrees 1.7.9 (MODS: vytux_cousins, vytux_gallery3, vytux_pages, fancy_imagebar, fancy_treeview, Ancestral fan chart)
PHP 7.1.2, MySQL 5.7.17 x86_64 GPL, Nginx (mainline)
ged.vytux.com
Help translate Vytux Modules at translate.vytux.com/

Please Log in or Create an account to join the conversation.

More
5 years 1 week ago #2 by fisharebest
Replied by fisharebest on topic Example module code
> I am fairly sure that this code is just there to show what can be done and is not actually required for a custom module for any reason.

Correct.

Greg Roach - greg@subaqua.co.uk - @fisharebest@phpc.social - fisharebest.webtrees.net

Please Log in or Create an account to join the conversation.

  • vytux
  • Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
5 years 1 week ago #3 by vytux
Replied by vytux on topic [SOLVED] Example module code
Problem solved.

Vytautas

webtrees 1.7.9 (MODS: vytux_cousins, vytux_gallery3, vytux_pages, fancy_imagebar, fancy_treeview, Ancestral fan chart)
PHP 7.1.2, MySQL 5.7.17 x86_64 GPL, Nginx (mainline)
ged.vytux.com
Help translate Vytux Modules at translate.vytux.com/

Please Log in or Create an account to join the conversation.

Powered by Kunena Forum
}