Web form problems / bugs in current (dev, updated today) frappe framework?

I currently have problems with web forms.

(1) One of them complains about a keyword “filters”, although I didn’t set any filter. This error appears directly after clicking on “See on Website”, trying to access the “//new” URL.

Traceback (most recent call last):
  File "apps/frappe/frappe/website/serve.py", line 18, in get_response
    response = renderer_instance.render()
               ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "apps/frappe/frappe/website/page_renderers/document_page.py", line 40, in render
    html = self.get_html()
           ^^^^^^^^^^^^^^^
  File "apps/frappe/frappe/website/utils.py", line 524, in cache_html_decorator
    html = func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "apps/frappe/frappe/website/page_renderers/document_page.py", line 49, in get_html
    self.update_context()
  File "apps/frappe/frappe/website/page_renderers/document_page.py", line 64, in update_context
    ret = self.doc.get_context(self.context)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "apps/frappe/frappe/website/doctype/web_form/web_form.py", line 239, in get_context
    self.load_form_data(context)
  File "apps/frappe/frappe/website/doctype/web_form/web_form.py", line 328, in load_form_data
    field.options = get_link_options(
                    ^^^^^^^^^^^^^^^^^
  File "apps/frappe/frappe/utils/typing_validations.py", line 31, in wrapper
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "apps/frappe/frappe/website/doctype/web_form/web_form.py", line 687, in get_link_options
    value = frappe.get_cached_value(
            ^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: get_cached_value() got an unexpected keyword argument 'filters'

(2) So I’m trying to investigate and set up a fresh web form without any bells and whistles. This one complains about missing fields, which are indeed mandatory in the underlying doctype (“Select Doctype” in the form configuration), but I expressly checked “allow incomplete forms”. So why is this incomplete form not allowed?
The form consists of only one field anyway, and I did enter something before trying to save the web form.

Message
Error: Value missing for Airplane: Capacity
Error: Value missing for Airplane: Airline

Maybe the web form builder terminology is incomplete regarding WHAT EXACTLY is allowed to be incomplete, like “The form might not be filled out completely, but mandatory fields of the underlying doctype itself must still be entered, even if the form doesn’t even provide the relevant fields.”

So this might be an indirect hint to a design problem of the web form with respect to the doctype.

Anyway, the first error (1) is much more bothering, and I currently have no idea what causes it or could cause it.

Is there a known bug or recent or heavy work on web forms at the moment?

Now I added the missing mandatory fields to my second web form (2), and get the same error as in error (1):

Traceback (most recent call last):
  File "apps/frappe/frappe/website/serve.py", line 18, in get_response
    response = renderer_instance.render()
               ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "apps/frappe/frappe/website/page_renderers/document_page.py", line 40, in render
    html = self.get_html()
           ^^^^^^^^^^^^^^^
  File "apps/frappe/frappe/website/utils.py", line 524, in cache_html_decorator
    html = func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "apps/frappe/frappe/website/page_renderers/document_page.py", line 49, in get_html
    self.update_context()
  File "apps/frappe/frappe/website/page_renderers/document_page.py", line 64, in update_context
    ret = self.doc.get_context(self.context)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "apps/frappe/frappe/website/doctype/web_form/web_form.py", line 239, in get_context
    self.load_form_data(context)
  File "apps/frappe/frappe/website/doctype/web_form/web_form.py", line 328, in load_form_data
    field.options = get_link_options(
                    ^^^^^^^^^^^^^^^^^
  File "apps/frappe/frappe/utils/typing_validations.py", line 31, in wrapper
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "apps/frappe/frappe/website/doctype/web_form/web_form.py", line 687, in get_link_options
    value = frappe.get_cached_value(
            ^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: get_cached_value() got an unexpected keyword argument 'filters'

Installed Apps
Airplane Mode: v0.0.1 (recover-branch)
Arbeitszeit: v0.0.1 (develop)
Cabs App: v0.0.1 (develop)
Frappe Framework: v15.x.x-develop () (develop)

Hi @Peer:

Issue raised.

Seems it is just failing when you are using link field, and have not set Show Title in Link Fields for your linked doctype.

Probably related to this recent commit

Looks similar to this one from @buildwithhussain, maybe the same:

There is more regarding mandatoryness:

Thank you!

You even provided a workaround of sorts in your issue report, I’ll see if this can help me bridge the gap for now:

Just fails when Show Title in Link Fields is not activated on linked doctype.

So thank you again!

Strangely, it doesn’t allow me to set the “name” field as title.
If I enter “name” as Title field, check said box, I get a:

Message
Title field must be a valid fieldname

The name is autonamed by this expression:
format:{flight}-{source_airport_code}-{destination_airport_code}-{###}

And the name field does indeed exist in the table, I just checked using “bench mariadb”:

+--------------------------------------+----------------------------+----------------------------+---------------+---------------+--------->
| name                                 | creation                   | modified                   | modified_by   | owner         | docstatu>
+--------------------------------------+----------------------------+----------------------------+---------------+---------------+--------->
| 0093fe33cd-10-2023-00006-HAM-IST-007 | 2023-10-30 20:57:15.763282 | 2023-10-30 21:30:40.679666 | Administrator | Administrator |         >
| 0093fe33cd-10-2023-00006-HAM-IST-008 | 2023-10-30 21:18:48.538095 | 2023-10-30 21:19:45.221640 | Administrator | Administrator |         >
+--------------------------------------+----------------------------+----------------------------+------------

So what does it complain about?
It makes no sense to me. Or am I missing something?

Hi:

Meta fields (name, creation, owner, etc …) are not usable as title field.
As workaround use other field of your doctype as title, or use some “dummy” field for that …

Anyway, probably it will be fixed soon. PR is raised too.
Hope this helps.

The bug is fixed:

The form appears as it should.

Thanks for reverting a change gone wrong.