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

TypeError in mj_section.py #47

Closed
thomashandorf opened this issue Nov 17, 2023 · 4 comments
Closed

TypeError in mj_section.py #47

thomashandorf opened this issue Nov 17, 2023 · 4 comments

Comments

@thomashandorf
Copy link

Hi,

i got the following error:

File "/Users/handorf/.pyenv/versions/3.10.2/envs/ga3-exporter/lib/python3.10/site-packages/mjml/elements/mj_section.py", line 342, in renderWithBackground
vY = self._calc_origin_pos_value(is_y=False, bg_pos=bgPosY)
TypeError: MjSection._calc_origin_pos_value() got an unexpected keyword argument 'is_y'

seems to be a simple typo.

@FelixSchwarz
Copy link
Owner

Thank you for the bug report. Do you think you can provide a minimal mjml file which triggers the error? I would love to extend the test suite.

@thomashandorf
Copy link
Author

Hi Frank, sure, i extracted an example:

`

<mj-section background-color="#f8f8f8">
  <mj-column>
      <mj-image width="200px" align=left src="https://www.python.org/static/img/python-logo@2x.png" />
  </mj-column>
</mj-section>



<mj-section background-url="https://upload.wikimedia.org/wikipedia/commons/thumb/5/51/Daylight_saving_time_begin_UTC%2B2.png/640px-Daylight_saving_time_begin_UTC%2B2.png"
          background-size="contain"
          background-repeat="no-repeat"
          background-color="#333">
  <mj-column>
    <mj-text font-size="20px"><br><br><br><br></mj-text>
  </mj-column>
</mj-section>          
<mj-section background-color="white" padding-top="20px">
  <mj-column>
    <mj-text font-size="20px">Enjoy our Black Friday Savings!</mj-text>
    <mj-text padding-top="30px" font-size="14px" line-height="20px" >
      🎁 30% off Professional and Regular packages<br>
      🎁 15% off Add-ons<br>
      <br>
      Only Monday 20th through Sunday 26th of November 2023.
    </mj-text>
    <mj-button padding-top="30px" align=left background-color="#42B37D" href="https://example.com/">Get Offer Now</mj-button>

  </mj-column>
</mj-section>

<mj-section background-color="#f8f8f8" padding-top="20px">
  <mj-column>
    <mj-text font-size="12px" line-height="12px" color="#aaaaaa"><b>Brand</b></mj-text>
    <mj-text font-size="10px" line-height="14px" color="#aaaaaa">
      Impressum
      <a href="mailto:support@example.com">support@example.com</a><br>
    </mj-text>



  </mj-column>
</mj-section>
`

Thanks for the great work, by the way!

@FelixSchwarz
Copy link
Owner

minimal reproducer

<mjml>
  <mj-body>
    <mj-section background-url="http://site.example/test.png" background-size="contain">
      <mj-column>
        <mj-text>Foo Bar</mj-text>
      </mj-column>
    </mj-section>
  </mj-body>
</mjml>

@FelixSchwarz
Copy link
Owner

should be fixed in the latest main branch (8273334), I assume we'll do a new release once #45 is completed as well.

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