Skip to content

F/366 webform metadata - #395

Open
stankut wants to merge 6 commits into
developfrom
f/366-webform-metadata
Open

stankut wants to merge 6 commits into
developfrom
f/366-webform-metadata

Conversation

@stankut

@stankut stankut commented Nov 20, 2026

Copy link
Copy Markdown
Collaborator

No description provided.

@ds-bellcom ds-bellcom linked an issue Nov 23, 2026 that may be closed by this pull request
* develop:
  Release 6.1.1
  Fixed deprecated use of ReflectionProperty::setValue to set static value
  Added event subscriber to reset webform submissions state when processing job queue
  Added proper entity access checks on Maestro notification preview routes
continue;
}
$values = [];
foreach (array_keys($header) as $key) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If i understand correctly just using the headers from the builder here will not necessarily contain something that uniquely identifies the webform. Consider adding the webform id to the output and database table.

* Deletes metadata belonging to a deleted form.
*/
public function delete(string $uuid): void {
$this->database->delete('os2forms_metadata')

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the fifth time os2forms_metadata is typed out here. Consider using a class constant and using this in os2forms_metadata.install aswell.

];

if (isset($build['table']['operations']['apply_above'])) {
$build['table']['operations']['metadata_export'] = $exportLink;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So this would only display if operations (webform_bulk_form) is enabled? If this is on purpose then no worries.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In my opinion having the operations coloumn (Build, View, etc.) not last in this view is strange

Comment on lines +155 to +156
->sort('title')
->sort('id')

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't believe multiple sorts works as intented here. This would just sort with respect to webform ids.

'created_uid' => ['description' => 'Creator user ID, or NULL if unknown or system initiated.'] + $uid,
'created_username' => ['description' => 'Fixed creator username snapshot, or NULL if unknown.'] + $username,
'changed' => ['description' => 'Last form save time as a Unix timestamp, or NULL if unknown.'] + $timestamp,
'changed_uid' => ['description' => 'Last editor user ID, or NULL if unknown or system initiated.'] + $uid,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this used for?

type: module
description: 'Stores persistent creation, modification, and submission metadata for Webforms.'
package: OS2Forms
core_version_requirement: ^10 || ^11

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can remove ^10 here

$rows[] = [$label, ['data' => ['#plain_text' => (string) $value]]];
}

$form['os2forms_metadata'] = [

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This renders below the Save button. Consider making sure its above the Save button.

Comment on lines +4 to +5
and the latest completed submission date. Displays the data in the overview and
under **Settings > OS2Forms**.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I read this as there being a different view for displaying all the data. I think mentioning that it is on a specific webform's Settings > OS2Forms.

* @phpstan-param array<string, \Drupal\Core\Entity\EntityTypeInterface> $entity_types
*/
function os2forms_metadata_entity_type_alter(array &$entity_types): void {
$entity_types['webform']->setListBuilderClass(WebformMetadataListBuilder::class);

@jekuaitk jekuaitk Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think its worth noting that this is happening in the README. In Aarhus we already overwrite this, so we will not be able to use this out of the box.

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

Successfully merging this pull request may close these issues.

Mulighed for datatræk på metadata

2 participants