Skip to content
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

A Duplicate declaration on displayName() in MissingLink.php #195

Open
thilan-plato opened this issue Sep 18, 2024 · 7 comments
Open

A Duplicate declaration on displayName() in MissingLink.php #195

thilan-plato opened this issue Sep 18, 2024 · 7 comments

Comments

@thilan-plato
Copy link

Describe the bug

A Duplicate declaration on displayName() in src/links/MissingLink.php
`class MissingLink extends Link implements MissingComponentInterface
{
// Traits
// =========================================================================

use MissingComponentTrait;


// Static Methods
// =========================================================================

public static function displayName(): string
{
    return Craft::t('hyper', 'Missing Link');
}


// Properties
// =========================================================================

public ?int $linkSiteId = null;
public string|array|null $sources = '*';
public ?string $selectionLabel = null;


// Static Methods
// =========================================================================

public static function displayName(): string
{
    return Craft::t('hyper', 'Missing Link');
}

}`

Steps to reproduce

  1. just made a upgrade to craft 5 with the latest Hyper version

Craft CMS version

5.4.4

Plugin version

2.0.5

Multi-site?

No response

Additional context

No response

@thilan-plato thilan-plato changed the title A Duplicate declaration on displayName() A Duplicate declaration on displayName() in MissingLink.php Sep 18, 2024
@engram-design
Copy link
Member

Fixed for the next release. To get this early, run composer require verbb/hyper:"dev-craft-5 as 2.0.5".

@mikewink
Copy link

I did as you said above for a Craft CMS 4 to 5 upgrade and now the backend UI does not render any Hyper fields anymore and the frontend throws an error Cannot access offset of type verbb\hyper\models\LinkCollection in isset or empty. I do not get the field data anymore from what I see.

Looks like something is really broken now? I am on Craft CMS 5.4.4.

@engram-design
Copy link
Member

Can you check your log files at /storage/logs/hyper.log if there are any errors logged?

@mikewink
Copy link

Can you check your log files at /storage/logs/hyper.log if there are any errors logged?

Yes, there are:

2024-09-18 15:17:38 [ERROR] Hyper is being called before Craft is fully initialized. Ensure all element queries are wrapped with aCraft::$app->onInit() check.
2024-09-18 15:17:38 [ERROR] ReflectionException: Class "craft\behaviors\CustomFieldBehavior" does not exist in /var/www/html/vendor/yiisoft/yii2/di/Container.php:507
Next yii\di\NotInstantiableException: Failed to instantiate component or class "craft\behaviors\CustomFieldBehavior". in /var/www/html/vendor/yiisoft/yii2/di/Container.php:509

Followed by a long stack trace and multiple error like this.

@engram-design
Copy link
Member

Ah right, yep aware of this issue and working on it!

@engram-design
Copy link
Member

Should hopefully be fixed for the next release. To get this early, run composer require verbb/hyper:"dev-craft-5 as 2.0.5".

@mikewink
Copy link

Should hopefully be fixed for the next release. To get this early, run composer require verbb/hyper:"dev-craft-5 as 2.0.5".

It works again. I will test more and leave more feedback if I find something to report. Thank you. Do you have an idea when you will release the next regular update (2.0.6)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants