From c31c264b0b5a18e173869d533017f91437336a46 Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Sat, 7 Oct 2023 22:06:47 -0400 Subject: [PATCH 1/3] Normalize template variables in Widget\VCard - Display new links in vier - Address https://github.com/friendica/friendica/issues/13157#issuecomment-1751750581 --- src/Content/Widget/VCard.php | 18 ++++++++++-------- view/templates/widget/vcard.tpl | 6 ++++++ view/theme/frio/templates/widget/vcard.tpl | 16 ++++++++-------- 3 files changed, 24 insertions(+), 16 deletions(-) diff --git a/src/Content/Widget/VCard.php b/src/Content/Widget/VCard.php index d57f7130f9..1d5cde87b4 100644 --- a/src/Content/Widget/VCard.php +++ b/src/Content/Widget/VCard.php @@ -68,6 +68,8 @@ class VCard $follow_link = ''; $unfollow_link = ''; $wallmessage_link = ''; + $mention_label = ''; + $mention_link = ''; $showgroup_link = ''; $photo = Contact::getPhoto($contact); @@ -102,15 +104,13 @@ class VCard } if ($contact['contact-type'] == Contact::TYPE_COMMUNITY) { - $mention_label = DI::l10n()->t('Post to group'); - $mention_url = 'compose/0?body=!' . $contact['addr']; - $showgroup_label = DI::l10n()->t('View group'); - $showgroup_url = 'network/group/' . $id; + $mention_label = DI::l10n()->t('Post to group'); + $mention_link = 'compose/0?body=!' . $contact['addr']; + $showgroup_link = 'network/group/' . $id; } else { $mention_label = DI::l10n()->t('Mention'); - $mention_url = 'compose/0?body=@' . $contact['addr']; + $mention_link = 'compose/0?body=@' . $contact['addr']; } - } return Renderer::replaceMacros(Renderer::getMarkupTemplate('widget/vcard.tpl'), [ @@ -131,8 +131,10 @@ class VCard '$unfollow_link' => $unfollow_link, '$wallmessage' => DI::l10n()->t('Message'), '$wallmessage_link' => $wallmessage_link, - '$mention' => [$mention_label, $mention_url], - '$showgroup' => [$showgroup_label, $showgroup_url] + '$mention' => $mention_label, + '$mention_link' => $mention_link, + '$showgroup' => DI::l10n()->t('View group'), + '$showgroup_link' => $showgroup_link, ]); } } diff --git a/view/templates/widget/vcard.tpl b/view/templates/widget/vcard.tpl index 9e38eebfc5..2656be487e 100644 --- a/view/templates/widget/vcard.tpl +++ b/view/templates/widget/vcard.tpl @@ -41,6 +41,12 @@ {{if $wallmessage_link}}
  • {{$wallmessage}}
  • {{/if}} + {{if $mention_link}} +
  • {{$mention}}
  • + {{/if}} + {{if $showgroup_link}} +
  • {{$showgroup}}
  • + {{/if}} diff --git a/view/theme/frio/templates/widget/vcard.tpl b/view/theme/frio/templates/widget/vcard.tpl index 814dec49ed..9f030a8ef0 100644 --- a/view/theme/frio/templates/widget/vcard.tpl +++ b/view/theme/frio/templates/widget/vcard.tpl @@ -56,22 +56,22 @@ {{/if}} - {{if $contact.addr}} + {{if $mention_link}} - {{/if}} - {{if $contact.forum==1 || $contact.prv==1}} + {{/if}} + {{if $showgroup_link}}
    -
    - {{/if}} + {{/if}}
    From 1506068f7cf93e8975220573932a2e41394dc38a Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Sat, 7 Oct 2023 22:29:06 -0400 Subject: [PATCH 2/3] Add callstack to log messages to better troubleshoot warning messages --- src/Core/Logger/Util/Introspection.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Core/Logger/Util/Introspection.php b/src/Core/Logger/Util/Introspection.php index 0b703da825..c154eec9f5 100644 --- a/src/Core/Logger/Util/Introspection.php +++ b/src/Core/Logger/Util/Introspection.php @@ -23,6 +23,7 @@ namespace Friendica\Core\Logger\Util; use Friendica\App\Request; use Friendica\Core\Logger\Capability\IHaveCallIntrospections; +use Friendica\Core\System; /** * Get Introspection information about the current call @@ -86,6 +87,7 @@ class Introspection implements IHaveCallIntrospections 'line' => $trace[$i - 1]['line'] ?? null, 'function' => $trace[$i]['function'] ?? null, 'request-id' => $this->requestId, + 'stack' => System::callstack(10, 4), ]; } From 298973a7e367003edcfbea9afb1752da168057b1 Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Sun, 8 Oct 2023 08:55:48 -0400 Subject: [PATCH 3/3] Add a couple of missing fields in Content\Item->localize - Address "Undefined array key "author-alias"" in Content\Item->localize:323 --- src/Content/Item.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Content/Item.php b/src/Content/Item.php index c94ec1299b..c604f26215 100644 --- a/src/Content/Item.php +++ b/src/Content/Item.php @@ -297,7 +297,7 @@ class Item if ($this->activity->match($item['verb'], Activity::TAG)) { $fields = [ - 'author-id', 'author-link', 'author-name', 'author-network', + 'author-id', 'author-link', 'author-name', 'author-network', 'author-link', 'author-alias', 'verb', 'object-type', 'resource-id', 'body', 'plink' ]; $obj = Post::selectFirst($fields, ['uri' => $item['parent-uri']]);