Problem

As the focus of module is to upload file first and then click alias link to the document, if no file uploaded then no use of url field. I am able to save form without file but with url alias, I think that is a bug or improvement.

Steps to reproduce

Install a "Path file" module by composer or by downloading.

Go to Administrator menu => content => path file

Then pathfile entity dashboard will be visible, click on add path file right corner button or link.

path file

Issue fork path_file-3187799

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

chandravilas created an issue. See original summary.

chandravilas’s picture

StatusFileSize
new550 bytes

This attach patch fulfils requirements for required mandatory field.
https://www.drupal.org/files/issues/2020-12-11/file_field_required-31877...

chandravilas’s picture

Status: Active » Needs review

batigolix made their first commit to this issue’s fork.

batigolix’s picture

I think all fields should be mandatory because otherwise it doesnt maken a lot of sense. So I updated the merge request to reflect that. this can be reviewed

batigolix’s picture

Version: 8.x-1.0 » 2.0.0
Issue tags: +finalist-sprint
batigolix’s picture

Assigned: chandravilas » Unassigned
arjenk’s picture

Status: Needs review » Reviewed & tested by the community

Tested MR !13.

First confirmed the non-required fields: a save with empty fields was possible, and even crashed the page with an error.

The patch adds a ->setRequired(TRUE) to the fields, and is clean. After applying the patch, the three fields were required, and save is blocked. (even URL alias had a test on starting with a '/').

phpcs/phpstan all good, pipeline green. RTBC.

batigolix’s picture

Status: Reviewed & tested by the community » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.