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

No URL field on page load in Craft 3.5RC3 #113

Closed
daltonrooney opened this issue Jul 26, 2020 · 12 comments
Closed

No URL field on page load in Craft 3.5RC3 #113

daltonrooney opened this issue Jul 26, 2020 · 12 comments
Labels

Comments

@daltonrooney
Copy link

When custom URLs are the default, the url field isn't visible when the page first loads. Toggling the link type seems to fix the issue:

2020-07-25 18-03-38 2020-07-25 18_04_51

I believe I'm using the latest 2.0 beta of the linkfield plugin.

@sebastian-lenz
Copy link
Owner

Hi @daltonrooney, thank you for getting in touch. I've just upgraded my test install to Craft 3.5.0-RC3 and I cannot reproduce your issue, the link fields seem to behave like expected.

Do you see any other weird behaviors on the site, e.g. are there other fields not working properly, are there any outputs in the JavaScript console, etc? Are there other plugins involved on the edit page? I guess this happens when you create a new entry, or does this behavior also show up on existing entries?

@daltonrooney
Copy link
Author

Thanks for the reply @sebastian-lenz. This behavior seems to be universal, across new entries, existing entries, and I just found the same behavior in globals that were previously working in 3.4:

linkfield

In this case it's link field inside a matrix. The Entry selection is not preserved after the edit page reloads. No obvious messages in the Console or in the web.log file.

@daltonrooney
Copy link
Author

I thought it might be useful to include the markup of the field that is being generated when the page is first loaded:

<div id="fields-registerLink-field" class="field width-100" aria-describedby="fields-registerLink-field-instructions" data-type="lenz\linkfield\fields\LinkField">
    <div class="heading">
      <label id="fields-registerLink-label" class="" for="registerLink"><span class="primary-label">Register Link</span><span class="alt-label"><code>registerLink</code></span></label>
      <div id="fields-registerLink-field-instructions" class="instructions">
        <p>Full URL, including https://</p>
      </div>
    </div>
    <div class="input ltr">
      <div class="linkfield withSettings" id="fields-registerLink-registerLink">
        <div class="linkfield--field">
          <div class="linkfield--type">
            <div class="select">
              <select id="fields-registerLink-type" name="fields[registerLink][type]">
                <option value="empty">
                  (No link)
                </option>
                <option value="url" selected>
                  Url
                </option>
              </select>
            </div>
          </div>
          <div class="linkfield--typeOptions">
            <div class="linkfield--typeOption url hidden">
              <input type="url" id="fields-registerLink-cpForm-url-linkedUrl" class="text fullwidth" name="fields[registerLink][cpForm][url][linkedUrl]" value="" autocomplete="off">
            </div>
            <div class="linkfield--typeOption hidden"></div>
          </div>
        </div>
        <div class="linkfield--settings">
          <div id="fields-registerLink-customText-field" class="field">
            <div class="heading">
              <label id="fields-registerLink-customText-field-label" class="" for="fields-registerLink-customText">Custom link text</label>
            </div>
            <div class="input ltr">
              <input type="text" id="fields-registerLink-customText" class="text fullwidth" name="fields[registerLink][customText]" value="" autocomplete="off" placeholder="Custom link text">
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>

So I guess one question is why the hidden attribute has been added to <div class="linkfield--typeOption url hidden">?

@sebastian-lenz
Copy link
Owner

sebastian-lenz commented Jul 28, 2020

Thank you for the additional infos. After playing around further in the control panel by recreating the field configuration above I've been able to reproduce the issue. It seems to be a new behavior introduced by Craft 3.5.

I've contacted the Craft team to figure out whether the changed behavior was intended: craftcms/cms#6478

I'll keep you updated.

@daltonrooney
Copy link
Author

@sebastian-lenz I saw that Brandon added the related ticket to the 3.6 milestone. Do you think there's an interim solution for this issue? Is there another way I should be setting up my link fields to avoid the problem?

@curtishenson
Copy link

Was there a regression with this in the Craft 3.5 release?

Seemed to work fine in the RC's and now I'm seeing this exact behavior. Wasn't this commit supposed to fix it?

@daltonrooney
Copy link
Author

Confirmed, still not working for me in 3.5.0.

@mark-chief
Copy link

Do you think this will be “fixed” before 3.6? It’s going to stop me from updating to 3.5!

@sebastian-lenz
Copy link
Owner

Yes, this can be fixed and I'll do it as soon as possible. I was hoping the change in Craft CMS finds its way into the release but it unfortunately did not make it. I am currently on summer vacation so please give me some time to find a time slot to look into this.

sebastian-lenz added a commit that referenced this issue Aug 12, 2020
@sebastian-lenz
Copy link
Owner

sebastian-lenz commented Aug 12, 2020

I've just released version 2.0.0-beta.10 containing the fix.

@curtishenson
Copy link

Confirmed working for me. Thanks!

@sebastian-lenz
Copy link
Owner

Great, thank you for the feedback. I'll close this issue for now. If you encounter any other problems, please feel free to open a new issue.

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

No branches or pull requests

4 participants