-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uncaught Error: Call to a member function id() on string in #1
Comments
been a while since I looked at this code but you need to pass an array of
objects as a param there, not just their name
foreach ($gedcom['INDI'] AS $person) {
$person = new Person($person, $gedcom);
echo $person->_relationship([$person->mother()->father()->mother()]);
}
…On Sun, 2 Jan 2022 at 18:06, Airikr ***@***.***> wrote:
Hi.
I want to show the relationships between 2 people for my visitors, but
when I use _relationship, I get the following error:
Fatal error: Uncaught Error: Call to a member function id() on string in /var/www/html/genealogy/Person.php:628 Stack trace: #0 /var/www/html/genealogy/index.php(243): Person->_relationship() #1 {main} thrown in /var/www/html/genealogy/Person.php on line 628
I use the following:
foreach($gedcom['INDI'] AS $person) {
$person = new Person($person, $gedcom);
echo $person->_relationship('Alfred Johansson');
}
I get the same error message when I try to replace $person->_relationship('Alfred
Johansson'); with $person->relationship(['Alfred Johansson','Anders
Karlsson']);
How to resolve?
—
Reply to this email directly, view it on GitHub
<#1>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AACMZM7LDO2DVHN34AVJMK3UUCHZPANCNFSM5LD5EPLA>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
I rewrote this in javascript about five years ago I can probably support
that a bit better as that's what I'm using to generate my own website
http://www.clarkeology.com
…On Mon, 3 Jan 2022 at 10:58, Pauly ***@***.***> wrote:
been a while since I looked at this code but you need to pass an array of
objects as a param there, not just their name
foreach ($gedcom['INDI'] AS $person) {
$person = new Person($person, $gedcom);
echo $person->_relationship([$person->mother()->father()->mother()]);
}
On Sun, 2 Jan 2022 at 18:06, Airikr ***@***.***> wrote:
> Hi.
>
> I want to show the relationships between 2 people for my visitors, but
> when I use _relationship, I get the following error:
>
> Fatal error: Uncaught Error: Call to a member function id() on string in /var/www/html/genealogy/Person.php:628 Stack trace: #0 /var/www/html/genealogy/index.php(243): Person->_relationship() #1 {main} thrown in /var/www/html/genealogy/Person.php on line 628
>
> I use the following:
>
> foreach($gedcom['INDI'] AS $person) {
> $person = new Person($person, $gedcom);
> echo $person->_relationship('Alfred Johansson');
> }
>
> I get the same error message when I try to replace $person->_relationship('Alfred
> Johansson'); with $person->relationship(['Alfred Johansson','Anders
> Karlsson']);
>
> How to resolve?
>
> —
> Reply to this email directly, view it on GitHub
> <#1>, or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AACMZM7LDO2DVHN34AVJMK3UUCHZPANCNFSM5LD5EPLA>
> .
> Triage notifications on the go with GitHub Mobile for iOS
> <https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
> or Android
> <https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
>
> You are receiving this because you are subscribed to this thread.Message
> ID: ***@***.***>
>
|
Thank you for your reply. Unfortunately, that solution didn't work either 😕 I get the same error.
Yeah, I have starred that repo too 🙂 I'll give it a go when I have more time, but I would prefer to use as less JavaScript as possible (don't ask me why, haha). |
Hi.
I want to show the relationships between 2 people for my visitors, but when I use
_relationship
, I get the following error:I use the following:
I get the same error message when I try to replace
$person->_relationship('Alfred Johansson');
with$person->relationship(['Alfred Johansson','Anders Karlsson']);
How to resolve?
The text was updated successfully, but these errors were encountered: