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

Bugs found in Fred (MODX 3.0.1, Fred 2.0.2) #452

Open
pashabyvolia opened this issue Oct 26, 2022 · 2 comments
Open

Bugs found in Fred (MODX 3.0.1, Fred 2.0.2) #452

pashabyvolia opened this issue Oct 26, 2022 · 2 comments

Comments

@pashabyvolia
Copy link

When creating a theme based on Fred, I noticed a few bugs (MODX 3.0.1, Fred 2.0.2):

  • in the options of general settings (Figure 1) and settings of elements, the positioning of elements is lost. In the element settings, I solved the problem by placing each option in a separate group (Figure 2). There were no such problems with positioning in the MODX 2.8.x version.
    Figure 1
    figure_1
    Figure 2
    figure_2
  • in the option set "remote": "true" creates an empty input field
    figure_3
  • in some elements that are located below, when you select them with the mouse, the "Open settings" icon does not appear. At the same time, everything is fine with the upper elements (if there is only one element, the icon does not appear either).
    figure_4
  • "fred-import": "cta_settings" does not work in parameter sets. You need to create the parameters again.
  • when editing a page in Fred, an error occurs in the error log (ERROR @ .../core/vendor/xpdo/xpdo/src/xPDO/xPDO.php : 666) Could not load class: FredTheme from mysql.fredtheme
  • the modifier does not work in the FormIt that is called via Fred: &emailFrom=contact-us@[[++site_url:stripString=http::and:stripString=https::and:stripString=/:and: stripString=www.]]``

p.s. The first two bugs are the most critical of all. If necessary, I can provide private access to the environment where the bugs described above exist.

@matdave
Copy link
Contributor

matdave commented Oct 26, 2022

There's a lot of unrelated things here. I'll try to cover these.

We didn't change much if anything at all with the frontend on Fred for MODX 3 vs 2, the screenshots appear like you have some styling conflicts. Is your site in MODX Cloud? We may be able to take a look if it is there.

It appears you have "remote": true, within your "settings" and not at the same level... it should be:

{ "remote": true, "settings": [] }

not

{ "settings": [{ "remote": true}] }

The Open Settings block appears to be blocked by your styles. I'm guessing you have an overflow hidden or something going on there.

We use Fred Import on a few sites in MODX 3, so I'm not sure why you are having issues without seeing your full call.

I'll check for the FredTheme to see if an issue was introduced in the latest version.

Modifiers will work, but without seeing your full call it's hard to tell what is going on. You may need to add an uncached value to the site_url attribute, e.g. [[!++site_url, since you are calling it within an uncached snippet.

@pashabyvolia
Copy link
Author

Thank you @matdave for your answer, you helped me a lot and prompted me to look for the reasons. I will write about each point.

First, what is decided:

  • in the options of general settings and settings of elements, the positioning of elements is lost: the problem was in the css styles of the template:
form {background-color: #15A346;}
form label {position: absolute;}

I have a suggestion for this. Maybe, it is worth writing down properties in the Fred styles, so that no one else has problems with positioning:

form label {position: initial;}
form {background-color: initial;}
  • in some elements that are located below, when you select them with the mouse, the "Open settings" icon does not appear: the css property overflow: hidden of the wrapper block hides the icon for editing. I added data-fred-class value to the block class, and the problem disappeared.
  • in the option set "remote": "true" creates an empty input field : indeed, I wrote "remote": "true" incorrectly. Your advice helped me.
  • "fred-import": "cta_settings" does not work in option sets - due to my carelessness (as in the previous case), I did not pay attention to the fact that option sets are created without the settings property. The options import is working.

Failed to fix:

  • when editing a page in Fred, an error occurs in the error log (ERROR @ .../core/vendor/xpdo/xpdo/src/xPDO/xPDO.php : 666) Could not load class: FredTheme from mysql.fredtheme - the error continues to appear (unfortunately, my site is not on MODX Cloud). I specifically installed MODX, Fred, and Tagger again and found that the error shows in the console pops up as soon as I assign a tagged group to the template. At the same time, Tagger works fine.
  • the modifier does not work in the FormIt that is called via Fred: after calling the uncached [[!++site_url]] parameter, the modifier does not work. In the console show error: (ERROR @ .../core/components/formit/src/FormIt/Hook/Email.php : 325) [FormIt] An error occurred while trying to send the email. Invalid address: (From): contact-us@http://mu.domain/. If call FormIt without Fred, then there is no such problem with the modifier. My FormIt code below:
[[!FormIt?
    &hooks=`spam,email,FormItAutoResponder,FormItSaveForm`
    &submitVar=`contact-us`
    &placeholderPrefix=`co.`
    &formName=`Contact Us`
    &formFields=`name,email,subject,message`
    &emailTo=`{{ email_to }}`
    &validate=`name:required,email:email:required,message:required`
    &fieldNames=`name==Name,email==Email,subject==Subject,message==Message`
    &emailTpl=`tplContactFormReport`
    &fiarTpl=`tplContactFormReport`
    &emailSubject=`Message from the site "[[!++site_url]]"`
    &fiarSubject=`You left a message on the site "[[!++site_url]]"`
    &emailFrom=`contact-us@[[!++site_url:stripString=`http:`:and:stripString=`https:`:and:stripString=`/`:and:stripString=`www.`]]`
    &emailFromName=`[[!++site_name]]`
    &fiarFrom=`contact-us@[[!++site_url:stripString=`http:`:and:stripString=`https:`:and:stripString=`/`:and:stripString=`www.`]]`
    &fiarFromName=`[[!++site_name]]`
    &successMessage=`Message sent successfully!`
    &successMessagePlaceholder=`co.successMessage`
]]

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

2 participants