Account created on 28 July 2006, over 18 years ago
#

Recent comments

🇧🇷Brazil josesanmartin

The patch in comment #15 has a few problems:

-core_version_requirement: ^9.3 || ^10
+# version: VERSION
+core_version_requirement: ^9 || ^10 || ^11

1. It's adding a unnecessary "# version: VERSION" line:
2. It has not removed the support for Drupal 9. However, the required changes to support Drupal 11 break compatibility with Drupal 9, so it should no longer be supported.

+
+# Information added by Drupal.org packaging script on 2023-03-21
+version: '2.0.0'
+project: 'youtube'
+datestamp: 1679360588

3. The patch is adding information that is added by Drupal.org packaging script and thus should not be commited.

+use GuzzleHttp\Exception\RequestException;
 use Drupal\Component\Utility\Html;
 use Drupal\Component\Utility\UrlHelper;
+use Drupal\field\Entity\FieldConfig;
 use Drupal\Core\File\FileSystemInterface;
 use Drupal\Core\Language\LanguageInterface;
 use Drupal\Core\Link;
 use Drupal\Core\Url;
-use Drupal\field\Entity\FieldConfig;
 use Drupal\file\Entity\File;
 use Drupal\image\Entity\ImageStyle;
-use GuzzleHttp\Exception\RequestException;
+use \Drupal\Core\Utility\Error;
+use \Psr\Log\LogLevel;
+use Drupal\Core\File\FileExists;

4. The patch is messing up with the alphabetical order of the elements
5. The patch is putting a slash \ before the namespace, it should not
6. The patch is adding an unused use, \Psr\Log\LogLevel

-  preg_match("/^(?:http(?:s)?:\/\/)?(?:www\.)?(?:youtu\.be\/|youtube\.com\/(?:(?:watch)?\?(?:.*&)?v(?:i)?=|(?:embed|v|vi|user|shorts)\/))([^\?&\"'<> ]+)/", $input, $matches);
+  preg_match("/^(?:http(?:s)?:\/\/)?(?:www\.)?(?:youtu\.be\/|youtube\.com\/(?:(?:watch)?\?(?:.*&)?v(?:i)?=|(?:embed|v|vi|user)\/))([^\?&\"'<> ]+)/", $input, $matches);

7. The patch is reverting a commit by mistake: https://git.drupalcode.org/project/youtube/-/commit/3a78b1da75fc4103e4ee...

-  $file = \Drupal::service('file.repository')->writeData($data, $destination, FileSystemInterface::EXISTS_REPLACE);
+  $file = file_save_data('File content', $destination, FileExists::REPLACE);

8. The patch is reverting to the use of file_save_data, which is deprecated in Drupal 9.3.0 and removed in Drupal 10.0.0.

Therefore I'm providing attached a new patch, it runs against 2.x-dev.

Production build 0.71.5 2024