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

WP upload fails #14

Open
chidifrank opened this issue Jan 25, 2025 · 0 comments
Open

WP upload fails #14

chidifrank opened this issue Jan 25, 2025 · 0 comments

Comments

@chidifrank
Copy link

chidifrank commented Jan 25, 2025

Problem:

Xebia blog WordPress uploads fail using the latest release 1.5.5

Reason:

Here a dict object with a URL attribute is expected in the code while a string URL is returned for meta field rank_math_facebook_image

reference: https://wordpress.org/support/topic/meta-key-names-postmeta-for-title-description-etc/ (only doc I could find...)

Note:

The same meta field is used twice, is this intentional or is another meta field meant to be retrieved? If not this is redundant.

        for name in ["rank_math_facebook_image","rank_math_facebook_image"]:
            post_og_images.append(post.get("meta", {}).get(name))

Stacktrace:

Traceback (most recent call last):
  File "/opt/hostedtoolcache/Python/3.12.8/x64/bin/wp-md", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/opt/hostedtoolcache/Python/3.12.8/x64/lib/python3.12/site-packages/click/core.py", line 1161, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.12.8/x64/lib/python3.12/site-packages/click/core.py", line 1082, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.12.8/x64/lib/python3.12/site-packages/click/core.py", line 1697, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.12.8/x64/lib/python3.12/site-packages/click/core.py", line 1697, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.12.8/x64/lib/python3.12/site-packages/click/core.py", line 14[43](https://github.com/xebia/xebia-blog/actions/runs/12963664305/job/36161510439?pr=127#step:9:44), in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.12.8/x64/lib/python3.12/site-packages/click/core.py", line 788, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.12.8/x64/lib/python3.12/site-packages/wordpress_markdown_blog_loader/upload.py", line 112, in command
    upsert_post(wordpress, blog)
  File "/opt/hostedtoolcache/Python/3.12.8/x64/lib/python3.12/site-packages/wordpress_markdown_blog_loader/upload.py", line [45](https://github.com/xebia/xebia-blog/actions/runs/12963664305/job/36161510439?pr=127#step:9:46), in upsert_post
    if not next(
           ^^^^^
  File "/opt/hostedtoolcache/Python/3.12.8/x64/lib/python3.12/site-packages/wordpress_markdown_blog_loader/upload.py", line [46](https://github.com/xebia/xebia-blog/actions/runs/12963664305/job/36161510439?pr=127#step:9:47), in <lambda>
    filter(lambda b: b and b.get("url") == og_image.url, post_og_images), None
                           ^^^^^
AttributeError: 'str' object has no attribute 'get'
error_occurred
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

1 participant